## Print path from root to all nodes in a Complete Binary Tree

Given a number N which is the total number of nodes in a complete binary tree where nodes are number from 1 to N sequentially… Read More »

## Generate all the binary strings of N bits

Given a positive integer number N. The task is to generate all the binary strings of N bits. These binary strings should be in ascending… Read More »

## Java Program to print distinct permutations of a string

Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of… Read More »

## Java ArrayList to print all possible words from phone digits

Given a keypad of a mobile, and keys that need to be pressed, the task is to print all the words which are possible to… Read More »

## Unique paths covering every non-obstacle block exactly once in a grid

Given a grid grid[][] with 4 types of blocks: 1 represents the starting block. There is exactly one starting block. 2 represents the ending block.… Read More »

## Print all permutations of a string in Java

Given a string str, the task is to print all the permutations of str. A permutation is an arrangement of all or part of a… Read More »

## Print all permutation of a string using ArrayList

Given a string str, the task is to print all the permutations of str. A permutation is an arrangement of all or part of a… Read More »

## Place K-knights such that they do not attack each other

Given integers M, N and K, the task is to place K knights on an M*N chessboard such that they don’t attack each other. The… Read More »

## Minimum swaps to group similar characters side by side?

Given a string, find minimum no of swaps(not necessarily adjacent) to convert it into a string which have similar characters side by side. Examples: Input… Read More »

## Horizontally Flip a Binary Matrix

Given a binary matrix. The task is to flip the matrix horizontally(find the image of the matrix), then invert it. Note: To flip a matrix… Read More »

## Minimum cost to reach a point N from 0 with two different operations allowed

Given integers N, P and Q where N denotes the destination position. The task is to move from position 0 to position N with minimum… Read More »

## Count all possible position that can be reached by Modified Knight

Given a chessboard of size 8 x 8 and the current position of Mirandote. All the rules of this chess game are same but the… Read More »

## Java Program for Phone Mnemonics

In our daily lives, we have to remember a lot of phone numbers. Most people find it quite difficult to remember such huge 10-digit phone… Read More »

## Rat in a Maze | Backtracking using Stack

Prerequisites – Recursion, Backtracking and Stack Data Structure. A Maze is given as N*M binary matrix of blocks and there is a rat initially at… Read More »

## Samsung Semiconductor Institute of Research(SSIR Software) Intern/FTE | Set-2

There are N Balloons marked with value Bi (where B(i…N)). User will be given Gun with N Bullets and user must shot N times. When… Read More »