Looks like insertion, doesn't it?
Computer Science
Level
4
What type of sort does the following function in C/C++ implement?
1 2 3 4 5 6 7 8 9 10 11 

Details and Assumptions:
a
is theint
array to be sorted, or more precisely, it denotes the base address of the array to be sorted.len
is the length of the arraya
, i.e., the number of elements in the array to be sorted.ord
specifies the sorting order, where1
is used for ascending sort and2
is used for descending sort.swap()
is a function which swaps the values of twoint
variables via a call by reference. The explicit definition for this function is:
1 2 3 4 5 
