Q.) Use heapsort to sort the letters“SEARCHINGEXAMPLE”. At each stage show the heap both in tree...
Show how Heapsort would sort the numbered list (clearly draw tree diagrams at each stage): {-2, 15, -9, 100, 52, 0}
Suppose the following array was created by heapDown during the heap creation part of the He 87 48 71 4015 [14 pts] Show the array as a tree. Show all the changes in the tree/array during the sort part Heapsort. a. 87
2. If you are using HeapSort to put elements in ascending order, what kind of heap should you use? Why? Conduct your HeapSort uisng the sequence given in task 1 (show the array after each round of sorting) (6 points)
Show diagrammatically (step by step), how the heapsort algorithm would sort the following numbered list (hint: you can use either a min or max-heap for this). {-6, 5, -3, 1, -10, 12, 0}
3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw the trees that result from the following operations: (a) Inserting 142, 400, 205, 127, 100, 320, 160, 141, and 110 into an initially-empty tree (in that order). (b) Deleting 142 from the tree you drew for part (a). 4. (8 points) Draw the unique binary tree that has a preorder traversal of 4, 1, 6, 3, 7, 5, 9, 2, 8 and an inorder...
Write a java class, MaxHeap, to implement a max-heap of values of type double. Use an array and be prepared to grow the array. The array implementation will probably be more efficient. Next, write three java sorting methods: a) One should be the heapsort algorithm. b) the second should sort the array by inserting all the elements from the array into a heap defined by the MaxHeap class, and then removing all the items from the heap and putting them...
Please I need Solution in an hour
show the steps for each algorthim
C++
1-Sort by steps in ascending way by Quick sort (3-way-partitioning) (ZAHRLI SME TJD BUNK) 2-Sort by steps ascending way by heap sort and heap construction and tree (ZAHRL I SME TJD BUNK). 3. Create the binary search tree( BST )from the 16 characters mentioned above and in steps, then delete the min and explain the result in steps. 4. Create a search tree 2-3 of the...
1. Consider the following unordered list: 20, 35, 25, 10, 40, 50, 45. Perform heap sort to sort this list in nondecreasing (ascending) order. a. Perform the bottom-up method to arrange these values into a max heap. Show the heapify operations on each relevant subtree. (10 points) b. Show the tree representation and the array representation of these numbers after every dequeue operation. Remember that dequeue does not delete a number. Dequeue will instead remove that number from the heap...
Use Figure 6.4 as a model, illustrate the operation of HEAPSORT
on the array
A = <4, 10, 7, 25, 8, 3>. Show all intermediate steps how the
heap is transformed.
6.4/
91|11|016 | 8|4|||7|V (9) 09
QUESTION 16 Show the first pass of sorting the following array-based binary tree max-heap. In other words, show the first step in sorting, then re-heap the remaining tree into a max-heap. For answers that are not used, put null. You may use scratch paper to draw the trees if you wish. (You will not need all the columns)