## Count number of ways to reach destination in a maze

Given a maze of 0 and -1 cells, the task is to find all the paths from (0, 0) to (n-1, m-1), and every path… Read More »

- Travelling Salesman Problem implementation using BackTracking
- Generate all the binary strings of N bits
- Rat in a Maze Problem when movement in all possible directions is allowed
- Generate all permutations of a string that follow given constraints
- Program to generate all possible valid IP addresses from given string | Set 2
- Count number of ways to reach destination in a maze
- Print path from root to all nodes in a Complete Binary Tree
- Print a given matrix in spiral form using direction tracking method
- Find triplet such that number of nodes connecting these triplets is maximum

Given a maze of 0 and -1 cells, the task is to find all the paths from (0, 0) to (n-1, m-1), and every path… Read More »

Given a 2-D matrix mat[][], the task is to print it in the spiral form. Examples: Input: mat[][] = { {1, 2, 3, 4}, {5,… Read More »

Given a string containing only digits, restore it by returning all possible valid IP address combinations. A valid IP address must be in the form… Read More »

Consider a rat placed at (0, 0) in a square matrix m[ ][ ] of order n and has to reach the destination at (n-1,… Read More »

Given a string, generate all permutations of it that do not contain ‘B’ after ‘A’, i.e., the string should not contain “AB” as a substring.… Read More »

Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route… Read More »

Given a Tree with N nodes, the task is to find a triplet of nodes (a, b, c) such that the number of nodes covered… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »