When building heap, is heap unique?

后端 未结 2 1320
无人及你
无人及你 2020-12-17 18:17

I\'m studying heap & heap sorting.
There is a array : arr[8] = {6,9,3,1,8,7,2,11}
When I\'m trying to build the heap, using code and pencil, I face

2条回答
  •  有刺的猬
    2020-12-17 19:16

    That's correct. The heap constraint (which is that children are not greater than their parents) does not completely specify the heap, so there is usually more than one possible arrangement.

提交回复
热议问题