Category Archives: Sorting


Youtube Video:

Analaysis though it seems little bit tough to me:

HackerRank video:

MIT video:

Pseudo Code from upper Youtube vid:



Slightly edited in *A to A[]:

Some change with before and after show:

Complete Quicksort Implementation and taking user input:

Output from the above code:

Geeks for geeks:

From geeks for geeks but may be there might be some problems there

ideone example:
Others Code:

Google Search Terms:*

Sorting Algorithm : Insertion Sort

From this two video I tried to re learn and implement the algorithm with pseudo code.


Implemented Code in C:

2015-08-07 13_30_30-C__Users_User_Desktop_insertionsort.exe

Here ary[] means array 🙂


Harvard CS50 course:

GeeksForGeeks Algo Implement(Not Worked Yet):
Practice Problem:

CLRS Theory:

Simple Implementation of Insertion Sorting(Idea Sanfoundry):

It is helpful:

Time complexity of Insertion Sort:

  • Worst case complexity : O(n^2)
  • Best case complexity :    O(n)
  • Average case complextiy:  O(n^2)Reference:

How to calculate complexity there is a example available at the upper video “Lecture 7”

and there are some links

Here a good presentation about this sorting


For descending order I took help from:
Here they change the comparison value for descending at while loop condition

Another good website:

Time complexity of insertion sort when there are O(n) inversions?

For some theory revise this video is good: