## 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...

## Managing gtk+ memory: application interview Question

GTK+ is cross platform graphical user interface library previously known as GIMP (GNU image manipulation program) toolkit. it is most popular GUI library along with Qt(Nokia) GUI library in...

## Write a function to reverse singly linked list

Link lists have been favorite question asked in interview. The efficient answer by professionals makes positive response as well it is sign of good concepts. there are two method...