My code is printing the indices instead of the elements

Link to my code-

Kindly rectify.

hey @7nishit your call to function is wrong instead of quicksort(a, 0, n) please write quicksort(a, 0, n-1). Also in partition function select the pivot element randomly as always selecting the last element results in O(n^2) complexity in the worst case.