Time complexity of the safety algorithm which creeks?


Consider a system which has ‘n’ number of processes and’ number of resources types. The time complexity of the safety algorithms which creeks, whether a system is in a safe state or not, is of the order of

  1. O(mn)
  2. O(m^n^2)
  3. O(m^2n)
  4. O(mn^2)


The answer will 2) O(m^n^2) where m represents number of resources and n represents number of processes.