Category Archives: Algorithm

Best, Average, Worst Case

cheat sheet:
Good for Programmers:

It’s also good:

It’s good for space complexity and cost.

Golden rules :

Not good for programmers but okay:

Will watch it later:

Asymptotiic Notation


অ্যালগোরিদম কমপ্লেক্সিটি(বিগ “O” নোটেশন)

For Upper Bound Lower Bound Clear:

C revise


Monk and Welcome Problem

Another Problem:


CP Resource


From beginner to expert in competitive programming.


Notes and courses for competitive programming


Algorithm Journey A to Z revise

URI Online Judge | 1030 Flavious Josephus Legend

This is level 3 problem so will do it later. But this video will help for  sure.


How to count numbers from string ?



Depth Firtst Search(DFS) Algorithm Explanation and Implementation



One of my classmates blog link:
and this ppt :
CLRS website:

Shafayet Ashraf:

saurabhschool youtube link :

Youtube video of Mifta Sintaha:

and here is also a good implementation:

Java array basics:

What does it actually mean in an array limit 0≤A[i]≤10^10 ?

Its means that the value of A[i] must be remained between 0 to 10000000000

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:

C code using Euler Method

Problem: Here we have to find dy/dx=x+y where y(0)=1 at the point x=0.05 and x=0.10 taking h=0.05


  1. Start
  2. Define function
  3. Get the values of x0, y0, h and xn
    *Here x0 and y0 are the initial conditions
    h is the interval
    xn is the required value
  4. n = (xn – x0)/h + 1
  5. Start loop from i=1 to n
  6. y = y0 + h*f(x0,y0)
    x = x + h
  7. Print values of y0 and x0
  8. Check if x < xn
    If yes, assign x0 = x and y0 = y
    If no, goto 9.
  9. End loop i
  10. Stop





Algorithm Presentation