pastebin

Paste Search Dynamic
Recent pastes
quicksortbad
  1. def quicksortbad(l):
  2.   if len(l) < 2:
  3.     return(l)
  4.   else:
  5.     pivot = l[0]
  6.     smaller = [l[j] for j in range(1,len(l)) if l[j] < pivot]
  7.     bigger = [l[j] for j in range(1,len(l)) if l[j] > pivot]
  8.     rearrange = quicksortbad(smaller) + [pivot] + quicksortbad(bigger)
  9.     return(rearrange)
Parsed in 0.002 seconds