Skip to content

Category Archives: Backtracking

Given an array A[] of size N, the task is to find the maximum score possible of this array. The score of an array is… Read More
Given a matrix mat[][] of dimension N*M, a positive integer K and the source cell (X, Y), the task is to print all possible paths… Read More
Given an array arr[] consisting of 4 integers each between [1-9], the task is to check whether it is possible to get the number 24… Read More
Given a string S consisting of N digits, the task is to find the number of distinct Prime Numbers that can be formed using the… Read More
Given two matrices sudoku[][] and region[][] of size N * N, the task is to fill the given Sudoku on the basis of the given… Read More
Given a string S consisting of N digits, the task is to print all possible combinations of the digits of the S that is a… Read More
Given a string S consisting of N characters and an array M[] of pairs of characters such that any character M[i][0] can be replaced with… Read More
Given a string S consisting of N characters, the task is to find the minimum number of pairs of characters that are required to be… Read More
Given an array of strings, arr[] of size N and a string S, the task is to find if it is possible to map integers… Read More
There are many ways of classifying algorithms and a few of them are shown below: Implementation Method Design Method Other Classifications Classification by Implementation Method:… Read More
Given an array of strings, words[] of size M and a string target of size N. The task is to find the minimum number of… Read More
Given an undirected Graph consisting of N nodes in the form of an adjacency matrix graph[][] of size N*N, the task is to print all… Read More
Given a string S of size N, consisting of digits [0 – 9] and character ‘.’, the task is to print the string that can… Read More
Given N nodes valued by [1, N], an array arr[] consisting of N positive integers such that the ith node ( 1-based indexing ) has… Read More