Professional KnowledgeHardIBPS SO IT
The time to build a binary heap from n arbitrary elements using the bottom-up (Floyd) method is:
- A. O(n log n)
- B. O(n)
- C. O(log n)
- D. O(n^2)
Correct answer: B. O(n)
Most nodes are near the leaves and sift down short distances, summing to a linear total.
Practise more IT Officer Professional Knowledge (IBPS SO) questionsIT Officer Professional Knowledge (IBPS SO): notes and key points
More IT Officer Professional Knowledge (IBPS SO) questions
- Preorder of a BST is 50, 30, 20, 40, 70, 60, 80. Its postorder is:
- Inserting 10, 20, 30, 40, 50, 25 in an AVL tree, the root of the final tree is:
- Which of these is a self-balancing tree guaranteeing height O(log n) using colour bits?
- Insert keys 12, 22, 32, 42 into a hash table of size 10 with h(k) = k mod 10 and linear probing. Position of 42 is:
- Time complexity of finding the k-th smallest element in an unsorted array in the worst case using median-of-medians is:
- Recurrence T(n) = 3T(n/2) + n solves to: