Which data stucture ia used for sorted or semi sorted data ?.?
AVl tree or heap sort
Answers
Answered by
0
The answer depends on the use you intend to put the data structure to. That is, if you want to
1. Insert a bunch of nodes
2. Remove the smallest node(s)
3. Repeat ad infinitum
Then a Heap is probably the answer.
If you want to
1. Insert a bunch of nodes
2. Look up some nodes by their key
3. Repeat ad infinitum
Then an AVL tree is the answer.
Answered by
0
‘AVl tree’ is used for ‘sorted or semi sorted data structure’
Explanation:
- 'AVL tree' is a self-adjusting 'Binary Search Tree (BST)' where the variation between ‘heights of left’ and ‘right subtrees’’ should not be more than one for all 'nodes'. This was the first such 'data structures' to have been created.
- ‘AVL tree’ tests the left and the ‘right sub-trees’ height value and ‘guarantees that the difference is not more than 1’. If the difference in the height of the ‘left and right sub-trees' is greater than 1, the ‘tree is balanced’ by some ‘rotation techniques’.
To know more
Difference between complete binary tree and avl tree
https://brainly.in/question/3070832
Write an algorithm for the implementation of an AVL tree.
https://brainly.in/question/5341410
Similar questions