From the resource allocation logic, it's clear that even numbered processes are taking even numbered resources and all even numbered processes share no more than 1 resource. Now, if we make sure that all odd numbered processes take odd numbered resources without a cycle, then deadlock cannot occur. The "else" case of the resource allocation logic, is trying to do that. But, if n is odd, Rn-i and Rn-i-2 will be even and there is possibility of deadlock, when two processes requests the same R., and Rj. So, only B and D are the possible answers. Now, in D, we can see that Po requests Ro and R2, P2 requests R2 and R4, so on until, P18 requests R18 and R.20. At the same time P₁ requests R40 and R38, P3 requests R.38 and R36, so on until, P17 requests R24 and R.22. 1.e.; there are no two processes requesting the same two resources and hence there can't be a cycle of dependencies which means, no deadlock is possible. But for B, Ps requests Rg and R10 and P11 also requests R10 and Rs. Hence, a deadlock is possible. (Suppose Pg comes first and occupies Rg. Then P11 comes and occupies R10. Now, if Ps requests R10 and P11 requests Rg, there will be deadlock) Correct Answer: B