I am trying to sort a list of names using insertion sort. In my insertion sort function at the bottom of my code i am attempting to pass the integer N into my string array which i know i cannot do. I could do the insertion sort with integers but have no idea how to tell the computer to alphabetize names or how to pass the string array into my loops in the selectionSort function.
¿Why would be any difference? std::string has defined the operator< that does a lexicographical comparison.
If you want another order relationship (like no-case) do the test with that.
By the way arrays go from 0 to n-1 so
1 2 3
while(N <= size)
{
pivot = array[N]; //out of bounds