Question: Please help with this data structures & algorithms homework!? 1. (10 pts) There is a unique decision tree T for insertion sort on five element
Please help with this data structures & algorithms homework!?


1. (10 pts) There is a unique decision tree T for insertion sort on five element 1, a2, a3, a4, a5 Draw the portion of the tree T showing the path from the root node to the leave node a5, a4, a3, az, al For each node, you need to show the comparison made. For each edge, you need to label it with either YES or NO 2. (10 pts) There is a unique decision tree T for quicksort on five element a 1, a2, a3, a4, a5 Draw the portion of the tree T showing the path from the root node to the leave node K a5, a4, a3, a2, a1 For each node, you need to show the comparison made. For each edge, you need to label it with either YES or NO 3. (10 pts) In class, we have studied the linear time algorithm for selection. In that algorithm we have used groups of size 5. Suppose we are using groups of size 13 derive the corresponding recurrence formula What is the corresponding time complexity of the algorithm? 4. (5 pts) You are given the sequence 1 2 3 4 5 6 7 8 9 Ali 2 4 6 8 10 12 14 16 18 Compute the max heap using the linear time build-heap algorithm. Show the resulting heap in array format (as in the above) 5. (5 pts) You are given the sequence 1 2 3 4 5 6 7 8 9 Ali 2 4 6 8 10 12 14 16 18 Compute a max-heap by sequentially inserting All), A12 AL9) into the originally empty max-heap. Show the resulting heap in array format (as in the above)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
