mirror of
				https://github.com/onyx-and-iris/grokking-algorithms.git
				synced 2025-10-31 04:21:47 +00:00 
			
		
		
		
	
		
			
				
	
	
	
		
			410 B
		
	
	
	
	
	
	
	
			
		
		
	
	
			410 B
		
	
	
	
	
	
	
	
Quicksort
Similar to the previous recursive function, quicksort uses divide and conquer.
The base case occurs for an array size 0 or 1 (doesn't need to be sorted).
The recursive case works by partitioning the array around a chosen pivot repeatedly until the base case is met and then combining all sorted sub-arrays.
Note. Quicksort should be implemented using a random pivot to ensure average runtimes.