## Dynamic Programming – Subset Sum Problem

Objective: Given a set of positive integers, and a value sum S, find out if there exist a subset in array whose sum is equal to given sum S. Example: int[] A = {...

Skip to content# Category: Expert

## Dynamic Programming – Subset Sum Problem

## The Word Break Problem

## Backtracking – Knight’s Tour Problem

## Backtracking – Search a Word In a Matrix

## Backtracking – N Queens Problem – Better Solution

## Backtracking – N Queens Problem

## Breadth-First Search/Traversal in a Graph.

## Backtracking – Rat In A Maze Puzzle

## Backtracking – SUDOKU Solver

## Merge K Sorted Arrays

## Populate Next Siblings Pointers in a Given Binary Tree OR Populate Next Right Pointers in Each Node

## Diameter Of a Binary Tree

## Binary Min – Max Heap

## Colorful Numbers

## Print All the Subsets of a Given Set (Power Set)

@tutorialhorizon

Objective: Given a set of positive integers, and a value sum S, find out if there exist a subset in array whose sum is equal to given sum S. Example: int[] A = {...

Objective : Given an string and a dictionary of words, find out if the input string can be broken into a space-separated sequence of one or more dictionary words. Example: dictionary = [“I” ,...

Objective : A knight’s tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is...

Objective : Given a 2D matrix of characters. Check whether the word exist in the matrix or not. If it exists then print its path. All movements are allowed (right, left, up, down and...

Objective : In chess, a queen can move as far as she pleases, horizontally, vertically, or diagonally. A chess board has 8 rows and 8 columns. The standard 8 by 8 Queen’s problem asks...

Objective : In chess, a queen can move as far as she pleases, horizontally, vertically, or diagonally. A chess board has 8 rows and 8 columns. The standard 8 by 8 Queen’s problem asks...

Breadth-First Search ( or TraÂverÂsal) in a Graph is quite similar to Binary Tree. Click here to read about BFS in Binary Tree. Example: What is Breadth First Search: Breadth-first search (BFS) is an...

Given a maze, NxN matrix. A rat has to find a path from source to destination. maze[0][0] (left top corner)is the source and maze[N-1][N-1](right bottom corner) is destination. There are few cells which are...

Given a sudoku problem or partially filled sudoku, write a program to solve the sudoku. What is Sudoku: Sudoku is a puzzle where a partially completed grid is given and objective is to fill...

Objective: Given k sorted array, write an algorithm to merge Them into One sorted array. Example : int[][] A = new int[5][]; A[0] = new int[] { 1, 5, 8, 9 }; A[1] =...

Objective: – Given a binary tree with three pointers left, right and nextSibling). Write the program to provide the nextsibling pointers. This problem can also be referred as “Populating Next Right Pointers in Each...

Objective: – Given a binary tree, write an algorithm to find the diameter of the tree. What is Diameter Of a Tree: Diameter of tree is defined as A longest path or route between...

A binary heap is a heap data structure created using a binary tree. binary tree has two rules – Binary Heap has to be complete binary tree at all levels except the last level....

Objective: Given a number, find out whether its colorful or not. Colorful Number: When in a given number, product of every digit of a sub-sequence are different. That number is called Colorful Number. See...

Objective: Given a set of numbers, print all the posssible subsets of it including empty set. Power Set: In mathematics, PowerSet of any given set S, PS(S) is set of all subsets of S...

%d bloggers like this: