Posts that are related to Recursion.

## Python | Convert a nested list into a flat list

The task is to convert a nested list into a single list in python i.e no matter how many levels of nesting is there in… Read More »

## Sum of elements of all partitions of number such that no element is less than K

Given an integer N, the task is to find an aggregate sum of all integer partitions of this number such that each partition does not… Read More »

## Bank Of America (BA Continuum India Pvt. Ltd.) Campus Recruitment

Approved Offer. Bank Of America has visited our college for on campus recruitment . The recruitment consisted of 4 Rounds in total. The recruitment was… Read More »

## Tail recursion to calculate sum of array elements.

Given an array A[], we need to find the sum of its elements using Tail Recursion Method. We generally want to achieve tail recursion (a… Read More »

## Water Jug Problem using Memoization

Given two jugs with the maximum capacity of m and n liters respectively. The jugs don’t have markings on them which can help us to… Read More »

## Modular exponentiation (Recursive)

Given three numbers a, b and c, we need to find (ab) % c Now why do “% c” after exponentiation, because ab will be… Read More »

## Reduce a number to 1 by performing given operations

Given a number N. The task is to reduce the given number N to 1 in the minimum number of steps. You can perform any… Read More »

## Java 8 | Arrays parallelSort() method with Examples

Java 8 introduced a new method called as parallelSort() in java.util.Arrays Class. It uses Parallel Sorting of array elements Algorithm of parallelSort() 1. The array… Read More »

## Number of handshakes such that a person shakes hands only once

There are N number of persons in a party, find the total number of handshake such that a person can handshake only once. Examples: Input… Read More »

## Print all the combinations of a string in lexicographical order

Given a string str, print of all the combinations of a string in lexicographical order. Examples: Input: str = “ABC” Output: A AB ABC AC… Read More »

## Java Applet | Implementing Flood Fill algorithm

Flood Fill Algorithm is to replace a certain closed or a similarly coloured field with a specified color. The use of the FloodFill algorithm can… Read More »

## Backtracking | Introduction

Prerequisites : Recursion Complexity Analysis Backtracking is an algorithmic-technique for solving problems recursively by trying to build a solution incrementally, one piece at a time,… Read More »

## How will you print numbers from 1 to 100 without using loop? | Set-2

If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0”… Read More »

## Recursive program to print formula for GCD of n integers

Given a function gcd(a, b) to find GCD (Greatest Common Divisor) of two number. It is also known that GCD of three elements can be… Read More »

## Perform n steps to convert every digit of a number in the format [count][digit]

Given a number num as a string and a number N. The task is to write a program which converts the given number num to… Read More »