Question

(3) (10 points) Given the 8 numbers in an array representing a Maxheap below, show the arrangement of the numbers after a hea

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Array after heap.pop() operation :

61 7 53 3 1 43 29

Explantation :

ස . heap, pope ) . Is will remote and replace with node I ර ය (2) ශ ම | Apply heapify also |., ksre. : 61 , 1,532, 3, 4, 43,

Add a comment
Know the answer?
Add Answer to:
(3) (10 points) Given the 8 numbers in an array representing a Maxheap below, show the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the contents of a sorted array of size 6, shown below, show which indices of...

    Given the contents of a sorted array of size 6, shown below, show which indices of the array will be visited, and in what order, if the algorithm BinarySearch was to be performed on this array for the number 4. int theArray[] = {1, 2, 3, 6, 8, 9}; Following are example question & answer: Given the contents of a sorted array of size 7, shown below, show which indices of the array will be visited, and in what order,...

  • Given the following array index of a 5-based array implementation (indexes start at 5), representing an...

    Given the following array index of a 5-based array implementation (indexes start at 5), representing an array that has the dimensions 20 x 20 (20 rows of 20 elements each), what is the linear (1D) address or index for the array element below? Array1[6][7] Answer is 22. Please show steps

  • Suppose a binary tree data (in tiny written size) is stored in an array (A) as...

    Suppose a binary tree data (in tiny written size) is stored in an array (A) as given below and root is placed at “0”index. Note the array indices are in larger written size (0 to 74). Show the traversal data of the given tree for a)      In-Order Traversal b)     Post Order Traversal A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 28 13 36 15 9 22 44 7 10 75 33 19 15...

  • Assume that the following 8 numbers are elements of an array (7pt). 8, 7, 6, 5,...

    Assume that the following 8 numbers are elements of an array (7pt). 8, 7, 6, 5, 4, 3, 2, 1. Sort the array in ascending order by applying Merge sort, and show how the array looks after each step. Is merge sort has every-case time complexity? If your answer is yes, what is its every-case time complexity? If your answer is no, what is its worst case time complexity and at what condition it will have worst-case time complexity? If...

  • I need the answer selection 3. Given the array of 10 integers shown below, apply bubble...

    I need the answer selection 3. Given the array of 10 integers shown below, apply bubble sort to sort the array of values into descending order (i.e., from large to small). Show the content of the array after the 1" and 2 passes of bubble sort performed on the array. The bubble sort algorithm is given on the last page of the exam if you need a reference. selech 45 34 126 24 18 9021 19 55 Show the content...

  • Use C++ (2D Array) Write a program which: 1. Assigns data given below into the 2D...

    Use C++ (2D Array) Write a program which: 1. Assigns data given below into the 2D array of integers which is 10x10. 2. Prints out the contents of the 2D array after assigning the data to make sure correct data was assigned. 3. Figures out and prints out the square root of the sum of ALL the elements in the 2D array. 4. Figures out and prints out the average of ALL THE ELEMENTS in the 2D array. 5. Figures...

  • You are given an array containing integers in the sorted order: [O] [1] [2] [3] [4]...

    You are given an array containing integers in the sorted order: [O] [1] [2] [3] [4] [5] [6] [7] 6 9 17 29 33 41 58 61 [8] [9] [10] [11] [12] [13] 67 87 93 112 118 145 We want to find 12 in the given array, using binary search algorithm. The first comparison will be made with ----- 6 58 61 None. 12 is not in the array.

  • I need it in JAVA Write a program that randomly populates an array of size 100,...

    I need it in JAVA Write a program that randomly populates an array of size 100, sorts it, and then finds the median. The random numbers must be from 0-99 and all integer values. Also since there is an even set of numbers the median is found by taking the mean of the two middle numbers (In other words the 50th and 51st). You have to code your own sorting method. You may not use a built in java sorter....

  • The task involves writing a C++ program that determines the prime numbers between 1 and 100....

    The task involves writing a C++ program that determines the prime numbers between 1 and 100. The steps you should follow to identify the prime numbers are the following. 1. The number 1 is not a prime number, so it should be scratched. 2. Starting from the first prime number, which is 2, you scratch all the numbers that are the multiple of 2. You should not scratch out 2 itself. 3. The next number in the sequence after the...

  • _______________________________________________________________________________________________ java language-trace instructions". (20 points) Show the contents of the array below, once the contents...

    _______________________________________________________________________________________________ java language-trace instructions". (20 points) Show the contents of the array below, once the contents of the array below, once the "pivot" element is placed at its location after each call of the "Partition” algorithm, in the process of running Quick-Sort on said array. Arrange the data in ascending order (Trom Arrange the data in ascending order (from smallest to largest value). Always select the first element of the partition as "pivot" in data cat B. Apply sorting on...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT