implemented quick sort

Pivot as:
1- last element
2- first element
3- median of 3