Computer Science EngineeringHard
In a binary search tree, the inorder successor of a node that has a non-empty right subtree is
- A. the leftmost node of its right subtree
- B. the root of the whole tree
- C. the rightmost node of its left subtree
- D. its parent
Correct answer: A. the leftmost node of its right subtree
The next larger key is the minimum of the right subtree, found by going left repeatedly.
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
- Keys 50, 30, 70, 20, 40, 60, 80 are inserted into an empty BST in this order. The postorder traversal is
- 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