Computer Science EngineeringHard
An adjacency matrix representation of a graph with V vertices needs space
- A. Theta(V + E)
- B. Theta(V^2)
- C. Theta(E)
- D. Theta(V log V)
Correct answer: B. Theta(V^2)
It stores one entry for every ordered vertex pair regardless of the number of edges.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- Which hashing technique guarantees O(1) worst-case search time for a static set of keys?
- A singly linked list holds 1->2->3->4->5. After: p=head; while(p->next && p->next->next) p=p->next->next; what is p->data?
- The number of leaf nodes in a perfect binary tree of height 5 (root at height 0) is
- A simple graph has degree sequence 4, 3, 3, 2, 2. How many edges does it have?
- A graph is bipartite if and only if
- The max-heap [90, 80, 70, 60, 50] stored in an array has the key 85 inserted with the standard sift-up. The resulting array is