Suppose that we have numbers between 1 and 1,000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined ?
926, 203, 912, 241, 913, 246, 364
During a search in a binary search tree, every comparison narrows the range of keys that can still be visited: after going left of key k all later keys are below k, and after going right all later keys are above k. A valid sequence must keep every node inside the current open interval.
Step 1 — 926, 203, 912, 241, 913, …: at 912 the search goes left (364 < 912), so every later node must be below 912. The next-but-one node 913 is greater than 912, which is impossible.
Step 2 — 925, 221, 912, 245, 899, 259, 363, 364: the interval shrinks as (−, 925) → (221, 925) → (221, 912) → (245, 912) → (245, 899) → (259, 899) → (363, 899), and 364 lies inside, so it is valid.
Step 3 — 3, 400, 388, 220, 267, 383, 382, 279, 364: intervals (3, −) → (3, 400) → (3, 388) → (220, 388) → (267, 388) → (267, 383) → (267, 382) → (279, 382); every node fits, so it is valid.
Step 4 — 3, 253, 402, 399, 331, 345, 398, 364: intervals (3, −) → (253, −) → (253, 402) → (253, 399) → (331, 399) → (345, 399) → (345, 398); 364 fits, so it is valid.
926, 203, 912, 241, 913, 246, 364 option is correct.
Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?
In a ____the left and right subtrees for any given node, differ in height by more than one.
Which of the following description(s) is/are true:
A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.
B. Trie - Used for efficient prefix - based searches.
C. AVL Tree - self balancing binary search tree with looser balance criteria than a Red Black Tree.
D. B- Tree - Allows efficient search, inert, delete operations in disk based system.
Choose the correct answer from the options given below:
__________ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice as long as the path from the root to nearest leaf.
The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?
Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?
In a ____the left and right subtrees for any given node, differ in height by more than one.
Which of the following description(s) is/are true:
A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.
B. Trie - Used for efficient prefix - based searches.
C. AVL Tree - self balancing binary search tree with looser balance criteria than a Red Black Tree.
D. B- Tree - Allows efficient search, inert, delete operations in disk based system.
Choose the correct answer from the options given below:
__________ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice as long as the path from the root to nearest leaf.