You are on page 1of 1

4.

a. The keys are arranged in an ascending order.


b. It can be traversed by doing a right-parent-left since the original Inorder traversal gives us a
pattern of left-parent-right.

5.

a. O(h) where h is height of Binary Search Tree. A traversal from the root to the deepest node may
become possible and the height of the tree may turn into n and the time complexity is
converted into O(n) for search and insert operations.
b. The BST must be balanced first. The height of the tree is changed into log(n) and the Time
Complexity for the BST operations is equal to O(logn).

6.

a. A search tree is a type of tree structure dedicated in locating specific keys from the set. It has
multiple variations, including AVL trees, B-Trees, Binary Search Trees. The Binary Search Trees in
general, are search trees that has a maximum of 2 children. The similarity between AVL trees
and B-Trees is that they are both balanced trees ,but the AVL tree, on the other hand, is a self-
balancing binary search tree while B-Trees are not binary trees. The nodes have more children,
which increases per-node search time but decreases the number of nodes the search needs to
visit.
b. 1. Given = 1000 keys -> n-1 = 1000-1 -> maximum height = 999

Given = 1000 keys -> minimum height = 9

2.

You might also like