Start with an empty heap of integers and enter the 10 numbers, 1 through 10. Array of data is given as following: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10). Draw the resulting heap on a draft paper for your convenience then answer these two questions: (a) What is the start index? (b) What are the two indexes that you did swap as your last step before having a Max Heap? O A. (a) 5 (b) 1 and 8 B. (a) 10 (b) 4 and 9 OC. (a) 10 (b) 4 and 8 OD. (a) 5 (6) 4 and 8 E. (a) 5 (b) 5 and 10

Respuesta :

The start index   5 the two indexes that you did swap as your last step before having a Max Heap 1,8 The Correct answer is A. (a) 5 (b) 1 and 8

What is Heap?

  • The heap property states that in a max heap, for any given node C, if P is a parent node of C, then the key (the value) of P is greater than or equal to the key of C. In computer science, a heap is a specialised tree-based data structure that is essentially an almost complete tree that satisfies this property. 
  • P's key in a min heap is less than or equal to C's key. The root node is the node that is at the "top" of the heap and has no parents
  • Priority queues are an abstract data type, and the heap is one extremely effective way to implement them. Priority queues are frequently referred to as "heaps," regardless of how they are implemented.

To learn more about Heap refer to:

https://brainly.com/question/7141585

#SPJ4

ACCESS MORE