## The Word Break Problem

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” ,...

@tutorialhorizon

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...

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...

SUDOKU Puzzle : The objective is to fill a 9Ã—9 grid with digits so that each column, each row, and each of the nine 3Ã—3 sub-grids that compose the grid (also called “boxes”, “blocks”,...

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...

Objective: Given an array of integers of size N, print all the subsets of size k. (k<=N) Example: Generate all subsets of a fixed size k of a given set [1,2,3…n]. e.g, if n=5...

%d bloggers like this: