Posts that are related to Recursion.

## Given a string, print all possible palindromic partitions

Given a string, find all possible palindromic partitions of given string. Example: Recommended: Please try your approach on {IDE} first, before moving on to the… Read More »

## Accolite Interview Experience | Set 7 (On-Campus)

Accolite visited our campus for full time Software development. First round: MCQ round consists of 30 questions 30 minutes. Questions on C aptitude, four to… Read More »

## Walmart Labs Interview Experience | Set 3 (On-Campus)

Walmart Labs Interview Experience – On campus 1st round (Online Test) It was an online test of 90 minutes and was conducted on Hackerearth. It… Read More »

## Minimum steps to reach a destination

Given a number line from -infinity to +infinity. You start at 0 and can go either to the left or to the right. The condition… Read More »

## Generate all possible sorted arrays from alternate elements of two given sorted arrays

Given two sorted arrays A and B, generate all possible arrays such that first element is taken from A then from B then from A… Read More »

## Flipkart Interview Experience | Set 24

Round 1 1) There are M chocolate packets each packet can have variable number of chocolates in each packet. There are N students (N <… Read More »

## How to print maximum number of A’s using given four keys

This is a famous interview question asked in Google, Paytm and many other company interviews. Below is the problem statement. Imagine you have a special… Read More »

## Given a matrix of ‘O’ and ‘X’, replace ‘O’ with ‘X’ if surrounded by ‘X’

Given a matrix where every element is either ‘O’ or ‘X’, replace ‘O’ with ‘X’ if surrounded by ‘X’. A ‘O’ (or a set of… Read More »

## Print all possible strings that can be made by placing spaces

Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. Input: str[]… Read More »

## Diagonal Sum of a Binary Tree

Consider lines of slope -1 passing between nodes (dotted lines in below diagram). Diagonal sum in a binary tree is sum of all node’s data… Read More »

## Flood fill Algorithm – how to implement fill() in paint?

In MS-Paint, when we take the brush to a pixel and click, the color of the region of that pixel is replaced with a new… Read More »

## Print all increasing sequences of length k from first n natural numbers

Given two positive integers n and k, print all increasing sequences of length k such that the elements in every sequence are from first n… Read More »

## Print all possible words from phone digits

Before advent of QWERTY keyboards, texts and numbers were placed on the same key. For example 2 has “ABC” if we wanted to write anything… Read More »

## Tail Recursion

What is tail recursion? A recursive function is tail recursive when recursive call is the last thing executed by the function. For example the following… Read More »

## Count all possible paths from top left to bottom right of a mXn matrix

The problem is to count all the possible paths from top left to bottom right of a mXn matrix with the constraints that from each cell… Read More »