Skip to content

Instantly share code, notes, and snippets.

View geeksambhu's full-sized avatar
🎯
Focusing

Shiva Gaire geeksambhu

🎯
Focusing
View GitHub Profile
def quick_sort(given_list):
if len(given_list) < 1:
return given_list
else:
pivot_element = given_list[0] #here I am choosing the first element to be a pivot
left = quick_sort([element for element in given_list[1:] if element < pivot_element]) # moving smaller to left
right = quick_sort([element for element in given_list[1:] if element > pivot_element]) #moving greater to right
return left + [pivot_element] + right
@geeksambhu
geeksambhu / about.md
Created December 27, 2016 18:33 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer