CSC230 Lab 12
Goal: This lab will help practice quick sort algorithm.
Our lecture discussed Quick Sort algorithm. In this lab, please implement quick sort
algorithm in lab12.cpp file. This executable file reads integers from an input file, which is
given at command line. The imported integers are stored in an internal int array. You can
make the array size to be 5000. In other words, we assume the input data file can have at
most 5000 integers. After importing the integers from the data file, the main() function
calls the quick sort function, then main() function prints out the result.
Three data files are provided in this lab. They are test, test100.txt, and test200.txt. The file
test has only 14 integers. I suggest you use test file to debug the code.
Once you finish the coding, type the following command to compile it.
g++ lab12.cpp –o lab12
The execution result of test.cpp is:
jikaili$ ./lab12 test
Quick Sort Result is:
Your implementation must have the exactly same result.
Jar you C++ files and the downloaded data files into lab12.jar. Submit the completed file to