## Write a program to find depth of binary search tree without using recursion

If a tree has just one node i.e root node, then the height is 0, if there are 2 levels of nodes then height is 1 and so on....

## What is the size of the C structure below on a 32-bit system? On a 64-bit?

What is the size of the C structure below on a 32-bit system? On a 64-bit? struct foo { char a; char* b; };...

## Pattern searching by KMP algorithm: Implementation in c Program

KMP (Knuth–Morris–Pratt) is a string searching algorithm which runs in O(m + n) time, where m is the length of the pattern and n is the length of the...

## write a c program to check if number is prime number

A prime number is number that can be divided only by 1 and itself.The only even prime number is 2. All other even numbers can be divided by 2.Zero...

## Write a c program for printing all permutation of a string

Write a c program for printing all permutation of a string is a good problem to learn recursive backtracking algorithm.Let us consider a string “abcd“. Then permutation of abc...

## struct packing and padding in c

Alignment Before going into details of struct packing and padding in c let us discuss alignment. Data alignment is related to the memory location where it is stored in...

## c program for quick sort algorithm

Write c program for quick sort algorithm. Quick sort algorithm is very popular algorithm. In average case it is O(NlogN) complexity however only issue with quick sort is the...

## Quick sort algorithm in glibc library:qsort and its comparator

Quicksort,is a sorting algorithm developed by Tony Hoare. average case makes O(n log n)comparisons to sort n items. In the worst case it makes O(n2) comparisons.Quicksort is often faster...

## Memory Layout of C program: Tutorial with example code

sometimes people asks question about runtime memory layout of c programs. before going into details let us write a simple code: #include<sdtio.h> #include<stdlib.h> int a; /* global uninitialized data...