I have a quicksort program here, but there seems to be a problem with the result. I think there must have been some issue in the areas highlighted below when referencing some values. Any suggestions?
#where l represents low, h represents high
def quick(arr,l,h):#is this the correct array for quicksorting?if len(x[l:h]) > 1:#r is pivot POSITIONr = h#R is pivot ELEMENTR = arr[r]i = l-1for a in range(l,r+1): if arr[a] <= arr[r]:i+=1arr[i], arr[a] = arr[a], arr[i]#should I take these values? Note that I have repeated elements below, which is what I want to deal withquick(arr,l,arr.index(R)-1)quick(arr,arr.index(R)+arr.count(R),h)x = [6,4,2,1,7,8,5,3]quick(x,0,len(x)-1)print(x)