Note
Here is a code for an integer variable n
while (n > 0)
{
n = n/10; // Use integer division
}
What is the worst case scenario analysis for the above loop?
O(1)
O(n)
O(n2)
Suppose we have a circular array implementation of a queue, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the push member function place the new entry in the array?
data[1]
data[2]
data[11]
In a graph G, F is a spanning forest of G if
(i)F is a subgraph of G containing all the nodes of G
(ii)F is an order forest containing trees T1,T2,...Tn
(iii)Ti contains all the nodes that are reachable in G from the root Ti and are contained in Tj for some j
Which of the above conditions is/are true?