Category: Algorithm

02
Jun
2017

Prime Finding: Sieve of Erastosthenes

I have watched the videos from mycodeschool and implemented it: code: //find all prime numbers upto n…

31
May
2017

Algo DS: Circular Queue

  code: #include<stdio.h> #define size 4 int q[size]; int rear=-1; int front=-1; Enqueue(int item){ if((rear+1)%size==front){ printf(“Queue Overflow\n”);…

26
May
2017

Data Structure: Queue

Stack VS Queue difference:   code: /* * C Program to Implement a Queue using an Array…

26
May
2017

Algorithm: BFS(Breadth First Search)

Theory: http://scanftree.com/Data_Structure/Breadth-First-Search Bangla: গ্রাফ থিওরিতে হাতেখড়ি-৪(ব্রেডথ ফার্স্ট সার্চ) Video: code implementation: Some other links may help: http://theoryofprogramming.com/2014/12/25/breadth-first-search-algorithm/…

16
May
2017

Fibonacci in C with Recursion

code from 1: #include<stdio.h> long getFibbTerm(int t) { if(t==1||t==2) return 1; return getFibbTerm(t-1)+getFibbTerm(t-2); } int main() {…

16
May
2017

Tower of Hanoi Recursion

code: #include<stdio.h> void toh(int n,int source,int aux,int dest) { if(n==1){ //just pick and place printf(“move the disk…