## C/C++ program for Z algorithm string matching

Z Algorithm Z algorithm is a linear time string matching algorithm which runs in O(n) complexity. Many programmers are still not aware this algorithm. It is used to find all occurrence...

## string matching z algorithm

string matching problem Given a pattern P find all occurrence of P in text T. For example if P = “aba ” and T = “bbabayababay’ ,then P occurs in...

## Maximum subarray problem

Maximum subarray problem is to find the largest contiguous sub-array which has largest sum total. For example in array {-1,-2,3,4} the largest contiguous array which has largest sum is...

## longest palindromic substring

Longest palindrome sub-string problem is famous for software programmers specially for interview purpose. you can be questioned to write a function that returns the longest palindrome in a given string. A palindrome...

## Disjoint-set data structure c++ implementation

Disjoint-set data structure is very useful data structure which keeps track of collection of items and its set, i.e which item belongs to which set. it is also called...

## longest common substring problem

Longest common substring problem is one of famous problem in computer science.Experienced c/c++ programmer can face this type of problem. Given two or more strings ,find the longest common...

## 8 queens problem all solutions in c

Write a c program to print all solutions of 8 queens problem? Given a 8×8 matrix as a chess board, place 8 queens on the chess board such that...

## Reverse all words but not string

Write a program such that it reverse all words but not the string. for example it input string is “i love programing” then its output should be “i evol...

## Write C code to Check Binary tree is BST or Not

We know that a binary tree is tree which satisfy following conditions: “A binary tree where the left child contains only nodes with values less than the parent node,...

## strassen’s matrix multiplication in c

A simple method for matrix multiplication would take O(N3) time. we can see the post http://wikistack.com/matrix-multiplication-in-c/ Strassen’s algorithm for matrix multiplication is one of divide and conquer algorithm. The...