Computer Science, asked by nlk49, 3 months ago

Which of the following does not correspond to a max-heap on the list of values [19, 28, 29, 31, 31, 45, 55, 72, 83, 97]?

Answers

Answered by arpitagjpatil
0

Answer:

97, 55, 83, 29, 45, 72, 31, 19, 31, 28]

Answered by mahinderjeetkaur878
0

None of the values in the list does not correspond to a max-heap.

A max-heap is a data structure where the parent node is greater than or equal to its children nodes. To determine if a given binary tree is a max-heap, we need to check if every parent node is greater than or equal to its children nodes.

In the list of values [19, 28, 29, 31, 31, 45, 55, 72, 83, 97], we can construct a max-heap as follows:

97

/ \

83 55

/ \ / \

31 45 29 72

/ \

19 28

In this max-heap, each parent node is greater than or equal to its children nodes. Therefore, all the values in the list correspond to a max-heap. None of the values in the list does not correspond to a max-heap.

A binary heap is a data structure that is used to represent a complete binary tree in which every level of the tree is completely filled, except possibly the last level, which is filled from left to right. There are two types of binary heaps: max-heap and min-heap. In a max-heap, the parent node is greater than or equal to its children nodes, and in a min-heap, the parent node is less than or equal to its children nodes.

To check if a given binary tree is a max-heap, we need to examine each parent node and compare it with its children nodes. In the given list of values [19, 28, 29, 31, 31, 45, 55, 72, 83, 97], we can construct a binary tree by inserting the values from left to right.

To know more: -

https://brainly.in/question/8948659?referrer=searchResults

https://brainly.in/question/55231104?referrer=searchResults

#SPJ3

Similar questions