Skip to main content
2 of 2
edited tags
quicksort
  • 4.3k
  • 1
  • 10
  • 21

How to build a heap better than Incremental and In-place method using decision tree?

For an array A = [a1, a2, a3, a4] of distinct numbers, I have built heap using binary decision tree by Incremental and In-place method.

Incremental method: enter image description here

In-place method: enter image description here

Is there a way to build heap using decision tree for inputs of size 4 that uses fewer decisions in the worst-case, compared to above methods?

Notes on heap: https://drive.google.com/open?id=0By6GDPYLwp2cY3lfbEVWNHlrSlE Incremental method - page 36, In-place method - page 48.

New_Coder
  • 135
  • 1
  • 1
  • 5