Page 1 of 1

2.2. (25) Given an array A of distinct integers, make use of the AVL tree to sort A in ascending order. a) (20) Write th

Posted: Fri May 20, 2022 5:45 pm
by answerhappygod
2 2 25 Given An Array A Of Distinct Integers Make Use Of The Avl Tree To Sort A In Ascending Order A 20 Write Th 1
2 2 25 Given An Array A Of Distinct Integers Make Use Of The Avl Tree To Sort A In Ascending Order A 20 Write Th 1 (41.19 KiB) Viewed 16 times
2.2. (25) Given an array A of distinct integers, make use of the AVL tree to sort A in ascending order. a) (20) Write the code for your algorithm. Note that: • you may use the Node struct and the functions insertNode(), destroy Tree() defined in the lecture notes without implementation; • you may define auxiliary functions; • and you do not have to write any include preprocessor. n - void AVLSort(int *A, int nx{ // input: A an array containing distinct integers // the size of A // output: when AVLSort() completes, A is sorted. // Your code here } b) (5) Prove that the time complexity of your algorithm is O(nlogn). Note: you do not have to prove the complexity of insertNode() and destroyTree().