Computer Science EngineeringVery hard
Keys 50, 30, 70, 20, 40, 60, 80 are inserted into an empty BST in this order. The postorder traversal is
- A. 20 30 40 50 60 70 80
- B. 20 40 30 60 80 70 50
- C. 20 40 30 50 60 80 70
- D. 50 30 20 40 70 60 80
Correct answer: B. 20 40 30 60 80 70 50
Postorder visits left subtree 20 40 30, then right subtree 60 80 70, then the root 50.
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
- A directed acyclic graph has n vertices. How many strongly connected components does it have?
- What is the minimum number of coins needed to make 11 using denominations {1, 5, 6, 9}?
- Huffman coding is applied to frequencies 5, 9, 12, 13, 16, 45. What is the total weighted path length (sum of internal node weights)?
- What is the Theta bound of: for(i=1;i<=n;i++) for(j=1;j<=n;j=2) count++;
- An adjacency matrix representation of a graph with V vertices needs space
- Which hashing technique guarantees O(1) worst-case search time for a static set of keys?