Let's review the options in detail:
Option (A) - True:
Circular wait is one of the necessary conditions for a deadlock. A circular wait occurs when a set of processes are each waiting for a resource that the next process in the cycle holds, creating a deadlock scenario. Therefore, circular wait is necessary for deadlock formation, though not sufficient on its own (other conditions like mutual exclusion, no preemption, and hold and wait are also required).
Option (B) - False:
A cycle in the wait-for graph does not necessarily indicate a deadlock if each resource has more than one instance. If there are multiple instances of resources, the system may be able to allocate resources such that the processes in the cycle do not get stuck. A cycle is only indicative of a potential deadlock in a single-instance resource allocation scenario.
Option (C) - False:
If the system enters an unsafe state, it does not necessarily mean that deadlock will occur. An unsafe state simply means that there is no guarantee of the processes completing without waiting indefinitely. However, deadlock may or may not occur, depending on how the processes execute.
Option (D) - True:
In a resource-allocation graph, if every edge is an assignment edge (from resource to process), then there cannot be a cycle involving resource requests. This ensures that deadlock cannot occur, because there are no circular dependencies between resources and processes. If there were request edges, deadlocks could potentially form through circular waiting. Therefore, option (D) is correct.
Thus, the correct answers are (A) and (D).