recategorized by
565 views
0 votes
0 votes
Would it be possible to implement a variant of heapsort based on a perfectly balanced ternary structure in which the children of node $i$ are at positions $3i - 1, 3i$, and $3i + 1$, and if so what would be the advantages and disadvantages of the new method?
recategorized by

1 Answer

0 votes
0 votes

Absolutely Yes, Infact we can have this for a perfectly balanced tree where each node has k children. Suppose we are talking about a node at position i.

Positions of children nodes starting from rightmost child are : $ki + 1, ki,ki-1.......$.

So only the number of nodes are changing, the main idea remains the same.

 

Related questions

1 votes
1 votes
1 answer
2
LavTheRawkstar asked Sep 9, 2018
1,030 views
Sort The Following Sequence of input using Heap sort.{ 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 }Please show the output at every pass because i am getting confused.
1 votes
1 votes
1 answer
4
reena_kandari asked Jul 30, 2016
987 views
The number of elements that can be sorted in time using heap sort ?