Month: March 2020

Queues and its implementation in C

A Queue is a First In First Out (FIFO) which is an ordered collection of items which are deleted at the front end and inserted...

Game Trees

Game Tree is one of the applications of Binary Trees. For example the one implemented for the Tic-Tac-Toe Game. X | X | X O...

Traversing a Binary Tree in C

There are generally 3 traversal strategies for Binary Trees – INORDER, PREORDER and POSTORDER. For eg:, the inorder, preorder and postorder traversal of an expression tree...

C program for Hailstones series

Hailstones is a sequence of numbers that could be generated from any positive number by performing a specific operation on it until it reaches 1....

for loops in C

The ‘for’  loop is another important looping structure which could replace ‘while’  and ‘do .. while’ loops. It has a special feature that the initialization,...

C program to implement Russian Peasant

Here is a C program that I wrote years back to implement Russian Peasant method of an interesting multiplication technique – main(){ int a, b,...

While Loop in C

Like do-while loop, While loop is the most commonly used looping construct to repeat a process or calculation for a set or collection of inputs...

Do – While Loops in C

Looping constructs is an important programming language technique to repeat a process or calculation for a set or collection of inputs or storage based on...

C Program to check for leap year

Here is a C program to check for leap year – main () { int year; printf("Please enter any year as 4 digits>> "); scanf("%d",...

Making decision in C program

Decision making is an important aspect of programming language that enables the programmer to arrive at a conclusion based on certain data processing, comparisons and conditional...