English, asked by sumitpandilwar123, 2 months ago

Three binary search tree are formed by inserting keys from 11 to 19 in different orders.
Which tree is worst for searching?
Tree A – 11, 12, 13, 14, 15, 16, 17, 18, 19
Tree B - 19, 18, 17, 16, 15, 14, 13, 12, 11
Tree C - 16, 14, 18, 12, 15, 11, 17, 19, 13
Tree B
Tree A
Tree C
Tree A and Tree B​

Answers

Answered by aditisinghdmv82
1

Answer:

tree A and tree B I think so

Answered by syed2020ashaels
0

Answer:

Tree B is the worst case senario

Explanation:

Of the three binary search trees, Tree B is the worst for searching.

In a binary search tree, the left child node has a key that is less than its parent node, and the right child node has a key that is greater than its parent node. As a result, a well-balanced binary search tree has a logarithmic height, which results in fast search times.

In Tree B, the keys are inserted in decreasing order, which means that the tree will be linear, with each node having only one child node. This means that searching in Tree B will take O(n) time, where n is the number of nodes in the tree, which is much slower than a well-balanced tree.

On the other hand, Trees A and C have their keys inserted in different, random orders, so they are likely to be well-balanced and have logarithmic heights, resulting in faster search times.

See more:

https://brainly.in/question/27334494

#SPJ3

Similar questions