Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Dynamic Programming
1.5k+ articles
Tree
1.4k+ articles
Data Structures
1.1k+ articles
Recursion
1k+ articles
DSA Quiz
320+ articles
Algorithms-Dynamic Programming
120+ articles
Algorithms-Recursion
59 posts
Popular Articles
Recent Articles
Backtracking Algorithm
Last Updated: 01 December 2024
Backtracking algorithms are like problem-solving strategies that help explore different options to find the best solution. They work by tryi
...read more
Backtracking
Algorithms-Backtracking
Algorithms-Recursion
DSA
Minimum steps to reduce N to 0 by given operations
Last Updated: 18 April 2023
Give an integer N, the task is to find the minimum number of moves to reduce N to 0 by one of the following operations:Reduce N by 1.Reduce
...read more
Dynamic Programming
Mathematical
Recursion
Algorithms-Dynamic Programming
Algorithms-Recursion
DSA
Print all possible ways to write N as sum of two or more positive integers
Last Updated: 02 February 2022
Given an integer N, the task is to print all the possible ways in which N can be written as the sum of two or more positive integers.Example
...read more
Greedy
Backtracking
Mathematical
Recursion
Arrays
Algorithms-Backtracking
Algorithms-Recursion
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Dynamic Programming
1.5k+ articles
Tree
1.4k+ articles
Data Structures
1.1k+ articles
Recursion
1k+ articles
DSA Quiz
320+ articles
Algorithms-Dynamic Programming
120+ articles
Program to find all Factors of a Number using recursion
Last Updated: 30 January 2022
Given a number N, the task is to print all the factors of N using recursion.Examples:Input: N = 16Output: 1 2 4 8 16Explanation:1, 2, 4, 8,
...read more
Mathematical
Recursion
School Programming
Algorithms-Recursion
factor
DSA
Recursion in Java
Last Updated: 12 July 2024
In Java, Recursion is a process in which a function calls itself directly or indirectly is called recursion and the corresponding function i
...read more
Java
java-basics
Algorithms-Recursion
Picked
Difference between Recursion and Iteration
Last Updated: 22 May 2023
A program is called recursive when an entity calls itself. A program is called iterative when there is a loop (or repetition).Example: Progr
...read more
Technical Scripter
Algorithms-Recursion
Picked
Technical Scripter 2018
DSA
Sum of the nodes of a Singly Linked List
Last Updated: 11 January 2023
Given a singly linked list. The task is to find the sum of nodes of the given linked list. Examples:Input: 7-6-8-4-1Output: 26Sum of nodes:7
...read more
Linked List
Data Structures-Linked List
Algorithms-Recursion
Traversal
DSA
Check if two trees have same structure
Last Updated: 20 September 2022
Given two binary trees. The task is to write a program to check if the two trees are identical in structure.In the above figure both of the
...read more
Tree
Trees
Binary Tree
Data Structures
Algorithms-Recursion
DSA
Water Jug Problem using Memoization
Last Updated: 21 March 2023
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 measure s
...read more
Dynamic Programming
Recursion
Algorithms-Dynamic Programming
Algorithms-Recursion
Memoization
DSA
Print all the combinations of a string in lexicographical order
Last Updated: 23 November 2021
Given a string str, print of all the combinations of a string in lexicographical order.Examples:Input: str = "ABC"Output:AABABCACACBBBABACBC
...read more
Algorithms
Backtracking
Recursion
C-String-Question
Algorithms-Backtracking
Algorithms-Recursion
lexicographic-ordering
DSA
All Leaves of a Bnary Tree - Print in Order
Last Updated: 15 August 2024
Given a binary tree, we need to print all leaf nodes of the given binary tree from left to right. That is, the nodes should be printed in th
...read more
Tree
Recursion
Algorithms-Recursion
DSA
recursive-approach
Algorithms | Recursion | Question 5
Last Updated: 28 June 2021
What does fun2() do in general?[tabby title="C"][sourcecode language="c"]int fun(int x, int y){ if (y == 0) return 0; re
...read more
DSA Quiz
Algorithms-Recursion
Algorithms | Recursion | Question 3
Last Updated: 28 June 2021
What does the following function print for n = 25?[tabby title="C"][sourcecode language="c"]void fun(int n){ if (n == 0) ret
...read more
DSA Quiz
Algorithms-Recursion
Algorithms | Recursion | Question 2
Last Updated: 28 June 2021
Consider the following recursive function fun(x, y). What is the value of fun(4, 3)[tabby title="C"][sourcecode language="c"]int
...read more
DSA Quiz
Algorithms-Recursion
Algorithms | Recursion | Question 9
Last Updated: 17 May 2019
Predict output of following program[tabby title="C"][sourcecode language="c"]#include int fun(int n){ if (n == 4) retur
...read more
DSA Quiz
Algorithms-Recursion
1
2
3
4
>>
Last
1
2
3
4
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !