InsertionSort ( A , n )
{
for i <-- 1 to n-1
{
value <-- A[i]
hole <-- i
while ( hole > 0 && A[hole - 1] > value )
{
A[hole] <-- A[ hole - 1 ]
hole <-- hole - 1
}
A[ hole ] <-- value
}
}
Tuesday, May 12, 2015
Subscribe to:
Post Comments (Atom)

well done
ReplyDelete