##
Print all n digit patterns formed by mobile Keypad
November 12, 2017

Given a number n. we need to print all N digit pattern formed by mobile Keypad. Note: we can move up, down, left, right from… Read More »

November 12, 2017

Given a number n. we need to print all N digit pattern formed by mobile Keypad. Note: we can move up, down, left, right from… Read More »

November 6, 2017

Given Binary matrix. Task is count all zeros which are surrounded by one (may not be immediate neighbor). Note: here we are only taking four… Read More »

October 22, 2017

Given n friends and their friendship relations, find the total number of groups that exist. And the number of ways of new groups that can… Read More »

September 21, 2017

A tree is always a Bipartite Graph as we can always break into two disjoint sets with alternate levels. In other words we always color… Read More »

August 23, 2017

Given two numbers n and k and you have to find all possible combination of k numbers from 1…n. Examples: Input : n = 4… Read More »

August 22, 2017

The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The… Read More »

August 10, 2017

Given a tree in form of adjacency list we have to calculate the number of nodes in the subtree of each node, while calculating the… Read More »

July 23, 2017

Given a string of characters of length less than 10. We need to print all the alpha-numeric abbreviation of the string. The alpha-numeric abbreviation is… Read More »

June 25, 2017

A directed acyclic graph (DAG) is a graph which doesn’t contain a cycle and has directed edges. We are given a DAG, we need to… Read More »

June 2, 2017

Given a directed tree with V vertices and V-1 edges, we need to choose such a root (from given nodes from where we can reach… Read More »

May 10, 2017

Given a weighting scale and an array of different positive weights where we have an infinite supply of each weight. Our task is to put… Read More »

May 1, 2017

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as… Read More »

March 31, 2017

Given a positive integer N. Consider a matrix of N X N. No cell can be accessible from any other cell, except the given pair… Read More »

March 23, 2017

Given an undirected connected tree with N nodes (and N-1 edges), we need to find two paths in this tree such that they are non-intersecting… Read More »

March 20, 2017

Given an undirected tree which has even number of vertices, we need to remove the maximum number of edges from this tree such that each… Read More »