Category Archives: Algorithm

Best, Average, Worst Case

cheat sheet:
http://bigocheatsheet.com/
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” নোটেশন)

http://pages.cs.wisc.edu/~vernon/cs367/notes/3.COMPLEXITY.html

http://discrete.gr/complexity/

http://50f7.blogspot.com/

For Upper Bound Lower Bound Clear:

http://cs50.wiki/Big+O+notation

C revise

 

Monk and Welcome Problem

Another Problem:

 

CP Resource

https://www.quora.com/What-are-some-good-resources-to-learn-C++-for-competitive-programming

http://blog.macacm.org/2016/06/courses-and-resources-to-excel-in.html

https://www.quora.com/What-was-Anudeep-Nekkantis-Competitive-Programming-strategy-to-become-35th-in-Global-ranking-in-just-6-7-months

 

http://www.spoj.com/problems/ARRAYSUB/

 

From beginner to expert in competitive programming.

https://www.quora.com/What-are-some-good-courses-on-competitive-programming

Algorithms

https://algo.is/

https://www.quora.com/Can-I-become-a-really-good-self-taught-programmer

Notes and courses for competitive programming

https://www.quora.com/India-Im-yellow-on-Topcoder-the-best-in-my-college-I-am-a-3rd-year-ECE-B-tech-student-with-arrears-and-I-have-CGPA-of-4-0-on-a-scale-of-10-0-I-have-immense-hatred-towards-my-ECE-branch-Im-afraid-I-might-not-get-placed-because-of-my-low-CGPA-What-should-I-do

Course:

https://www.udemy.com/introduction-to-algorithms-and-data-structures-in-c/

https://www.udemy.com/from-0-to-1-c-programming/

https://www.quora.com/How-did-Anudeep-Nekkanti-become-so-good-at-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 ?

code:

 

Depth Firtst Search(DFS) Algorithm Explanation and Implementation

 

 

References:
One of my classmates blog link: http://programminghelpbd.blogspot.com/2014/06/breadth-first-search-dfs-in-java.html
and this ppt : https://drive.google.com/file/d/0B0sCkwd_qKgJZEJzS1pWeXNmNUE/edit
CLRS website: http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm

Shafayet Ashraf: http://www.shafaetsplanet.com/planetcoding/?p=973

saurabhschool youtube link : https://www.youtube.com/watch?v=gCNsAKkUHPM

Youtube video of Mifta Sintaha:

and here is also a good implementation:
http://electrofriends.com/source-codes/software-programs/cpp-programs/cpp-data-structure/c-programs-for-the-implementation-of-depth-first-searchdfs-for-a-given-graph/comment-page-1/#comments

Java array basics: http://www.tutorialspoint.com/java/java_arrays.htm

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.

Pseudocode:

Implemented Code in C:

Output:
2015-08-07 13_30_30-C__Users_User_Desktop_insertionsort.exe

Here ary[] means array 🙂

Simulation:(Wikipedia)

Harvard CS50 course:
http://cs50.tv/2016/fall/

GeeksForGeeks Algo Implement(Not Worked Yet):

http://quiz.geeksforgeeks.org/insertion-sort/
Practice Problem:
http://www.practice.geeksforgeeks.org/problem-page.php?pid=700148
https://www.hackerearth.com/practice/algorithms/sorting/insertion-sort/practice-problems/
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A

CLRS Theory:

http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/insertionSort.htm

Simple Implementation of Insertion Sorting(Idea Sanfoundry):

It is helpful: http://www.sanfoundry.com/cpp-program-sort-array/

Time complexity of Insertion Sort:

  • Worst case complexity : O(n^2)
  • Best case complexity :    O(n)
  • Average case complextiy:  O(n^2)Reference:
    http://bigocheatsheet.com/

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

and there are some links
http://stackoverflow.com/questions/19827193/time-complexity-of-insertion-sort

Here a good presentation about this sorting

http://www.cs.mcgill.ca/~cs203/lectures/lecture7/sld006.htm

Reference: http://www.cquestions.com/2009/09/insertion-sort-algorithm.html

For descending order I took help from:
http://cboard.cprogramming.com/c-programming/73433-sorting-descending-order.html
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

Algorithm:

  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

 

Code:

 Output:

euler

Algorithm Presentation