Algorithm for banker's algorithm?

Can you answer this question?