Start
Load data
Load size of the data into n
Set index of inserted element according to formula (3)
while index of inserted element is in the range of the heap do
Proceed Algorithm to re-arrange elements into triple heap with
setting index of initial heap element as index of inserted element and index
of final heap element as n − 1
Reduce index of inserted element by 1
end
Stop
Algorithm 1: Algorithm to create triple heap
elements in the heap and build a triple heap are used to sort input sequences.