Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

# 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 &lt;iostream&gt; using namespace std; &#xA0;&#xA0; template&lt...

# 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&#x2026;. Read More ...

# 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...

# 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...

# 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[] =...

# 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...

# 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,...

# Postorder traversal of Binary Tree without recursion and without stack

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

# 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 / ...