## Graph – Count all paths between source and destination

Objective: Given a graph, source vertex and destination vertex. Write an algorithm to count all possible paths between source and … Read more

## Graph – Detect Cycle in a Directed Graph using colors

Objective: Given a directed graph write an algorithm to find out whether graph contains cycle or not. Example: Approach: Graph … Read more

## Graph – Detect Cycle in an Undirected Graph using DFS

Objective: Given undirected graph write an algorithm to find out whether graph contains cycle or not. Example: Approach: Earlier we … Read more

## Graph – Detect Cycle in a Directed Graph

Objective: Given a directed graph write an algorithm to find out whether graph contains cycle or not. Example: Approach: Graph … Read more

## Separate 0’s and 1’s in a given array

Objec­tive:  Given an array which contains only 0’s and 1’s. write an algorithm to separate 0’s and 1’s. Example int [] … Read more

## Find the last repeating character in a given string.

Objective: Given a string, write an algorithm to find the last repeating character in it. Example: String input = “horizon … Read more

## Dynamic Programming – Longest Common Subsequence

Objective: Given two string sequences, write an algorithm to find the length of longest subsequence present in both of them. … Read more

## Dynamic Programming – Rod Cutting Problem

Objective: Given a rod of length n inches and a table of prices pi, i=1,2,…,n, write an algorithm to find … Read more

## Dynamic Programming – Maximum size square sub-matrix with all 1s

Objective: Given a matrix of 0’s and 1’s (binary matrix). Find out the Maximum size square sub-matrix with all 1’s. … Read more

## Backtracking – Search a Word In a Matrix

Objective: Given a 2D matrix of characters. Check whether the word exists in the matrix or not. If it exists … Read more

## Check if one string is Rotation of another string

Objective: Write an algorithm to check if one string is Rotation of another string. This question has been asked in … Read more