I found this function written in python on the internet and I'm confused if it's a quick sort or not because it's written in one line and it work very well and quickly and I think that it work with the complexity of O (n*log n) even in the worst case, so this is the code:
def qsort(L):
return (qsort([x for x in L[1:] if x < L[0]]) +\
L[0:1] + \
qsort([x for x in L[1:] if x >= L[0]])) if L else []