CPSC250A Assignment 111 - Quick Sort

Due Friday September 30

An advantage of C++ templates and operator overloading is that it is possible to write a single function that works with both primitive and non-primitive data types. In this assignment you will write a function to sort an array.


The file vector_test.cc contains a program that allows the user to test the sort function of a template vector class. For this assignment, write the QuickSort function. The function should sort a vector in ascending order using the overloaded comparison operators (<, <=, >, >=, ==). It should also sort the vector in-place, that is, it should not allocate a second array to help with sorting. The code can either use loops or recursion. Be sure to test your code on multiple examples and on the cs server.


Tar your code in a file that contains your name and submit it on course Inquire site.