We already know we have to divide an array into two sub-array for quicksort algorithm. Here I’ll describe how this partitioning actually works. If you want to know about how quicksort works, follow my other post on quicksort working principle. I followed Introduction to Algorithms, 3rd Edition (MIT Press) for writing this tutorial. Continue reading “QuickSort: Partition an Array into Sub-array”

# Tag: programming

## QuickSort Algorithm Working Principle

QuickSort is the most elegant sorting algorithm with an average case time complexity of **O(nlogn)**. The main idea behind quick sort is divide and conquer. I’ll try to explain how this divide and conquer strategy works for quick sort. This writing is a gist from Introduction to Algorithms, 3rd Edition (MIT Press), a cool book for algorithm enthusiasts. Continue reading “QuickSort Algorithm Working Principle”

## Integer Pair With Given Sum From an Array

Finding an integer pair with given sum is a very familiar problem in algorithm community. The general problem is: given an array of integer numbers and a given sum, how do we find out a integer pair with given sum? Continue reading “Integer Pair With Given Sum From an Array”