Code:
//Quicksort
template <class Record>
void Sortable_list<Record>::quick_sort()
{
recursive_quick_sort(0, count - 1)
}
template <class Record>
void Sortable_list<Record>::recursive_quick_sort(int low, int high)
{
int pivot_position;
if (low < high)
{
pivot_position = partition(low, high);
recursive_quick_sort(low, pivot_position - 1);
recursive_quick_sort(pivot_position + 1, high);
}
}
I have data files stored in a vector and i need to sort it using the quicksort. This is the code that the professor supplied. How do I go about changing this so it works with a vector?
Thanks so much
Bookmarks