Question
Given an array of integers, do the following: 1 Toni Barnes [14, 14, 2, 10, 18, 7, 3, 3, 15, 10, 27, 23] 2 Ujjwal
Given an array of integers, do the following:
1 | Toni Barnes | [14, | 14, | 2, | 10, | 18, | 7, | 3, | 3, | 15, | 10, | 27, | 23] |
2 | Ujjwal Baskota | [17, | 13, | 16, | 7, | 25, | 11, | 4, | 22, | 10, | 21, | 28, | 29] |
3 | Albert Boateng | [16, | 12, | 11, | 29, | 21, | 17, | 8, | 19, | 18, | 10, | 10, | 3] |
4 | Ronnal Boyd | [18, | 28, | 2, | 27, | 18, | 16, | 29, | 2, | 0, | 6, | 8, | 9] |
5 | Deonte Buckner | [20, | 13, | 12, | 6, | 13, | 14, | 10, | 9, | 9, | 14, | 12, | 20] |
6 | Nissi Campbell | [11, | 27, | 27, | 5, | 29, | 6, | 22, | 22, | 16, | 7, | 27, | 19] |
7 | Samuel Ayalew Dagne | [26, | 9, | 29, | 9, | 0, | 23, | 5, | 23, | 23, | 24, | 2, | 18] |
8 | Zakeia Davis | [10, | 18, | 22, | 28, | 5, | 2, | 12, | 4, | 7, | 19, | 2, | 26] |
9 | Joshua Everett | [11, | 0, | 20, | 26, | 22, | 0, | 13, | 14, | 28, | 26, | 3, | 27] |
10 | Amanuel E. Gebre | [2, | 8, | 9, | 3, | 28, | 26, | 8, | 19, | 1, | 10, | 19, | 10] |
11 | James Harris | [22, | 24, | 24, | 18, | 15, | 5, | 7, | 0, | 3, | 20, | 20, | 13] |
12 | Jillian Hart | [12, | 27, | 0, | 16, | 6, | 23, | 28, | 16, | 3, | 13, | 29, | 26] |
13 | Ellis Hill | [3, | 14, | 14, | 29, | 26, | 19, | 20, | 27, | 26, | 0, | 17, | 27] |
14 | Demarcus Johnson | [25, | 13, | 14, | 21, | 25, | 3, | 10, | 27, | 18, | 25, | 15, | 25] |
15 | Demarius Jones | [15, | 3, | 18, | 16, | 8, | 6, | 14, | 15, | 28, | 12, | 23, | 18] |
16 | Ning Kang | [17, | 3, | 18, | 27, | 0, | 5, | 19, | 19, | 9, | 4, | 8, | 13] |
17 | Ji Mack | [6, | 15, | 16, | 20, | 23, | 6, | 11, | 18, | 17, | 1, | 18, | 22] |
18 | DeOnica Mitchell | [2, | 1, | 23, | 28, | 27, | 5, | 11, | 25, | 19, | 14, | 29, | 11] |
19 | Cortland Moten | [25, | 20, | 17, | 28, | 28, | 11, | 23, | 6, | 1, | 14, | 27, | 27] |
20 | Dakota Nichols | [21, | 15, | 1, | 16, | 11, | 2, | 29, | 11, | 8, | 16, | 23, | 25] |
21 | Sherrod Perry | [29, | 12, | 3, | 10, | 19, | 20, | 10, | 24, | 6, | 18, | 25, | 25] |
22 | Jontay Reynolds | [8, | 22, | 28, | 11, | 22, | 11, | 23, | 3, | 0, | 12, | 8, | 1] |
23 | Christopher Robinson | [24, | 24, | 14, | 17, | 7, | 25, | 27, | 17, | 22, | 4, | 0, | 11] |
24 | Keara Rogers | [3, | 27, | 18, | 25, | 23, | 14, | 3, | 24, | 3, | 17, | 10, | 12] |
25 | Ancornelius Sandifer | [9, | 10, | 28, | 2, | 5, | 21, | 8, | 10, | 4, | 4, | 10, | 26] |
26 | Varlin Sheffey | [24, | 22, | 18, | 9, | 20, | 10, | 25, | 21, | 3, | 3, | 14, | 7] |
27 | Timothy Stewart | [5, | 11, | 20, | 1, | 18, | 6, | 8, | 16, | 12, | 24, | 4, | 24] |
28 | Nebiyou Tadesse | [13, | 0, | 8, | 6, | 21, | 21, | 9, | 7, | 22, | 20, | 0, | 5] |
29 | Astride Tchakoua | [8, | 12, | 9, | 25, | 11, | 2, | 15, | 6, | 15, | 22, | 24, | 9] |
30 | Ingrid Tchakoua | [15, | 14, | 21, | 28, | 3, | 4, | 24, | 26, | 25, | 6, | 17, | 21] |
31 | Alexander Thomas | [19, | 20, | 8, | 14, | 7, | 7, | 4, | 18, | 5, | 29, | 28, | 10] |
32 | Eriana Thomas | [19, | 24, | 26, | 18, | 25, | 3, | 15, | 27, | 29, | 9, | 20, | 8] |
33 | Nia Whavers | [25, | 9, | 20, | 18, | 7, | 15, | 26, | 23, | 28, | 5, | 9, | 24] |
34 | Semenbari Yakubu | [29, | 26, | 9, | 23, | 28, | 27, | 23, | 11, | 20, | 7, | 9, | 23] |
35 | Taba Zimmerman | [8, | 6, | 1, | 29, | 2, | 4, | 5, | 11, | 1, | 24, | 15, | 12] |
(Q1 - 15 pts) Construct a max heap of the array. Show the initial essentially complete binary tree and the transformation of the binary tree to a max heap via the reheapify operations at the indices of the internal nodes (as shown in the slides.
(Q2 - 10 pts) Transform the max heap to a min heap (via direct transformation) using a sequence of reheapify operations.
(Q3 - 15 pts) Sort the min heap version (obtained from Q2) of the array (step by step) in order to obtain an array of reversely sorted integers.
(Q4 - 10 pts) Transform the max heap (obtained from Q1) to a binary search tree. Show all the steps.
(Q5 - 10 pts) Transform the binary search tree of (Q4) to a min heap. Show all the steps.
(Q6 - 5 pts) Differentiate between the binary trees/min heaps of (Q2) and (Q5) with respect to the nature of data distribution in the left sub tree and right sub tree of each internal node.
(Q7 - 10 pts) Consider the binary search tree of (Q4). Delete the root node of this binary search tree and do the necessary transformation (as discussed in the slides of Module 7) to get a new binary search tree.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started