Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
C C++ Recursion

Print 1 to 100 in C++, without loop and recursion

Following is a C++ program that prints 1 to 100 without loop and without recursion. #include <iostream> using namespace std;    template&lt...
C C++ c-puzzle

Print a number 100 times without using loop, recursion and macro expansion in C?

It is possible to solve this problem using loop or a recursion method. And we have already seen the solution using #define directive (Macro expansion) but what if al...

Recursion

Recursion : The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function…. Read More ...
Mathematical Fibonacci tail-recursion

Tail Recursion for Fibonacci

Write a tail recursive function for calculating the n-th Fibonacci number. Examples : Input : n = 4 Output : fib(4) = 3 Input : n = 9 Output : fib(9) = 34 Prerequi...
Tree threaded-binary-tree Tree

Inorder Non-threaded Binary Tree Traversal without Recursion or Stack

We have discussed Thread based Morris Traversal. Can we do inorder traversal without threads if we have parent pointers available to us? Input: Root of Below Tree [E...
Recursion Tree Recursion

Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)

Given Preorder traversal of a Binary Search Tree. Then the task is print leaf nodes of the Binary Search Tree from the given preorder. Examples : Input : preorder[] =...
Stack Tree tree-traversal

Inorder Tree Traversal without Recursion

Using Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step wise step execu...
Tree threaded-binary-tree tree-traversal

Inorder Tree Traversal without recursion and without stack!

Using Morris Traversal, we can traverse the tree without using stack and recursion. The idea of Morris Traversal is based on Threaded Binary Tree. In this traversal,...
Hash Tree cpp-unordered_map

Postorder traversal of Binary Tree without recursion and without stack

Prerequisite – Inorder/preorder/postorder traversal of tree Given a binary tree, perform postorder traversal. Recommended: Please try your approach on {IDE} ...
Tree Tree

Print root to leaf paths without using recursion

Given a binary tree, print all its root to leaf paths without using recursion. For example, consider the following Binary Tree. 6 / 3 5 / ...

Subscribe to Our Newsletter