## Recursion in Java

What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive… Read More »

- Zig-Zag traversal of a Binary Tree using Recursion
- Difference between Recursion and Iteration
- Generate a random permutation of elements from range [L, R] (Divide and Conquer)
- Program to unfold a folded linked list
- Find maximum product of digits among numbers less than or equal to N
- Recursion in Java
- Recursion in Perl

What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive… Read More »

Given an integer N > 0, the task is to find the maximum product of digits among numbers less than or equal to N. Examples:… Read More »

Recursion is a mechanism when a function calls itself again and again till the required condition is met. When the function call statement is written… Read More »

A linked list L0 -> L1 -> L2 -> ….. -> LN can be folded as L0 -> LN -> L1 -> LN – 1… Read More »

Given a Binary Tree, the task is to print the zigzag order of the tree. Examples: Input : 7 / \ 6 5 / /… Read More »

Given a range [L, R] where L ≤ R, the task is to generate a random permutation of the sequence [L, L + 1, L… Read More »

A program is called recursive when an entity calls itself. A program is call iterative when there is a loop (or repetition). Example: Program to… Read More »

Given a linked list, the task is to print the product of alternate nodes of the given linked list. Examples: Input : 1 -> 8… Read More »

Given a linked list, the task is to print the sum of the alternate nodes of the linked list. Examples: Input : 1 -> 8… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

Given a number and two digits and . The task is to find the least number not less than N which contains the equal number… Read More »

Given a number N, the task is to find the number of ways N can be partitioned, i.e. the number of ways that N can… Read More »

Let an be a sequence of numbers, which is defined by the recurrence relation a1=1 and an+1/an=2n. The task is to to find the value… Read More »

Given a Binary Tree as shown below. The task is to count all pair of adjacent nodes whose XOR is an odd number. Explanation: Initially,… Read More »

Given a singly linked list. The task is to find the sum of nodes of the given linked list. Task is to do A +… Read More »