a random element in array

Implement the QuickSort Algorithm; Your code should be in C++. The user should be allowed to choose between 3 options; which element considered a Pivot.
Pivot Choice 1: The last element in the list
Pivot Choice 2: The first element in the list
Pivot Choice 3: A random element in the array.


i solved the last element and the first element but i need your help plz to solve a random element
thank u
Read this:

http://www.cplusplus.com/reference/cstdlib/rand/

always put srand() at the top of main.

int Pivot_Choice_3 = rand() % number_of_elemnts_in_the_list;
thank u soooo much :$
Topic archived. No new replies allowed.