226k views
4 votes
Because an AVL tree is a binary search tree, the search algorithm for an AVL tree is the same as the search algorithm for a binary search tree.

True

False

User Timonsku
by
5.7k points

1 Answer

4 votes

Answer:

True, Yes the search algorithm for AVL tree and the binary search tree are same.

Because in both trees, of a certain a node, the smaller elements reside in the left sub-tree and the larger elements reside in the right sub-tree.

Step-by-step explanation:

So while searching an element in the AVL tree we start the search from the root node.

We compare the element to be searched with the root node.

if (element < root node), then move in left and compare with it's left child.

else move in right and compare with it's right child.

Similarly in next phase move accordingly as in the binary search tree.

User Megazoid
by
5.7k points