Skip to content

Tag Archives: tree-level-order

Given a binary tree, the task is to print the nodes of the tree in an anti-clockwise spiral manner.  Examples:  Input: 1 / \ 2… Read More
Given a binary tree, the task is to print the reverse level order in spiral form. Examples:  Input: 1 / \ 2 3 / \… Read More
Given a Binary Tree with distinct values, the task is to print the first smallest root to leaf path. We basically need to print the… Read More
Given a Binary tree, the task is to print all the internal nodes in a tree. An internal node is a node which carries at least… Read More
Given a Binary Tree, the task is to print the Reverse zigzag Order of the tree.Examples:   Input: 1 / \ 2 3 / \ \… Read More
Given a Binary Tree, print it’s left view. Left view of a Binary Tree is a set of nodes visible when tree is seen from… Read More
Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More
Given a binary tree and a node in the binary tree, find Levelorder successor of the given node. That is, the node that appears after… Read More
Given a binary tree and a node in the binary tree, find Levelorder Predecessor of the given node. That is, the node that appears before… Read More
Given a tree, with N nodes and E edges (every edge is denoted by two integers, X, Y stating that X is the parent of… Read More
Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More
Given the root of a binary tree and a key x in it, find the distance of the given key from the root node. Dis­tance… Read More
Given an array of elements, the task is to insert these elements in level order and construct a tree. Input : arr[] = {10, 20,… Read More
Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7.   Recommended:… Read More
Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More

Start Your Coding Journey Now!