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:
A, B & D only
Balanced search trees keep their height logarithmic in the number of keys, while a trie indexes strings character by character and a B-tree is a multiway balanced tree designed for block-oriented storage.
Statement A — a red-black tree keeps its height at most \(2\log_2(n+1)\), so search, insertion and deletion each take O(log n) time in the worst case. True.
Statement B — a trie stores keys along root-to-node paths of characters, so every key sharing a prefix lies in one subtree; prefix look-up and auto-completion are its main use. True.
Statement C — an AVL tree is a self-balancing binary search tree whose balance factor at every node must be −1, 0 or +1. This is a stricter balance condition than the red-black rule, which only keeps the longest root-to-leaf path within twice the shortest, so AVL trees are more rigidly balanced (shorter) than red-black trees. Calling the AVL criteria looser than those of a red-black tree reverses this. False.
Statement D — a B-tree has a high branching factor so that each node fills a disk block; search, insertion and deletion touch only O(logm n) blocks, which is why file systems and databases use it. True (“inert” is evidently “insert”).
Statements A, B and D are true and C is false. “A & B only” and “B only” leave out true statements, while “C & D only” includes the false statement about AVL balance and omits A and B.
A, B & D only 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 ?
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 ?
In a ____the left and right subtrees for any given node, differ in height by more than one.
__________ 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 ?
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 ?
In a ____the left and right subtrees for any given node, differ in height by more than one.
__________ 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.