# Tag Archives: Tree Traversals

Preorder traversal is defined as a type of tree traversal that follows the Root-Left-Right policy where: The root node of the subtree is visited first.â€¦ Read More
Postorder traversal is defined as a type of tree traversal which follows the Left-Right-Root policy such that for each node: The left subtree is traversedâ€¦ Read More
Given a Binary Search Tree, The task is to print the elements in inorder, preorder, and postorder traversal of the Binary Search Tree.  Input:  Aâ€¦ Read More
Given a binary tree, the task is to print all the nodes of the binary tree in Pre-order, Post-order, and In-order in one iteration. Examples:â€¦ Read More
Given a Binary Tree and an input array. The task is to create an Iterator that utilizes next() and hasNext() functions to perform Inorder traversalâ€¦ Read More
Given a Binary Search Tree consisting of N distinct nodes, the task is to flatten the given Binary Search Tree to convert the tree intoâ€¦ Read More
Given a Binary Search Tree, the task is to create a wave array from the given Binary Search Tree. An array arr[0..n-1] is called aâ€¦ Read More
Given a N ary Tree consisting of N nodes, the task is to find the minimum distance from node A to node B of theâ€¦ Read More
Given a generic tree consisting of N nodes, the task is to find the maximum sum of the path from the root to the leafâ€¦ Read More
Given a Generic Tree consisting of N nodes, the task is to find the left and right views of the given generic Tree. Examples: Input:â€¦ Read More
Given a Binary tree, and target sum as K, the task is to print all the possible paths from root to leaf that has theâ€¦ Read More
Given a Binary Tree, the task is to print the Bottom-left to Upward-right Traversal of the given Binary Tree i.e., the level order traversal havingâ€¦ Read More
Given a Binary Tree consisting of N nodes having values in the range [0, N – 1] rooted as 0, an array wt[] of sizeâ€¦ Read More
Given a Binary Tree, the task is to construct an array such that ith index of the array contains GCD of all the nodes presentâ€¦ Read More
Given an N-ary tree consisting of N nodes, the task is to find the node having the largest value in the given N-ary Tree. Examples:â€¦ Read More