Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Tree tree-level-order Tree

Perfect Binary Tree Specific Level Order Traversal

Given a Perfect Binary Tree like below: (click on image to get a clear view) Print the level order of nodes in following specific manner: ...
Tree Tree

Iterative Preorder Traversal

Given a Binary Tree, write an iterative function to print Preorder traversal of the given binary tree. Refer this for recursive preorder traversal of Binary Tree. To...
Tree tree-level-order Tree

Perfect Binary Tree Specific Level Order Traversal Set 2

Perfect Binary Tree using Specific Level Order Traversal in Set 1. The earlier traversal was from Top to Bottom. In this post, Bottom to Top traversal (asked in Amazo...
Tree cpp-queue Tree

Iterative diagonal traversal of binary tree

Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to same line. Input : Root of below tree...
Tree Tree

Morris traversal for Preorder

Using Morris Traversal, we can traverse the tree without using stack and recursion. The algorithm for Preorder is almost similar to Morris traversal for Inorder. 1......
Tree Tree

Density of Binary Tree in One Traversal

Given a Binary Tree, find density of it by doing one traversal of it. Density of Binary Tree = Size / Height Examples: Input: Root of following tree 10 / ...
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 Amazon Paytm

Diagonal Traversal of Binary Tree

Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to same line. Input : Root of below tree...
Tree Amazon Kritikal Solutions

Boundary Traversal of binary tree

Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root. For example, boundary traversal of the following tree is “2...
Stack Tree Stack

Modify a binary tree to get preorder traversal using right pointers only

Given a binary tree. Modify it in such a way that after modification you can have a preorder traversal of it using only the right pointers. During modification, you c...

Subscribe to Our Newsletter