# Tag Archives: Data Structures-Tree Traversals

Given a Binary Tree, the task is to find the maximum value of GCD from any path from the root node to the leaf node.… Read More
Given a binary tree, the task is to find the absolute difference between the even valued and the odd valued nodes in a binary tree.… Read More
A data structure is a particular way of organizing data in a computer so that it can be used effectively. In this article, the real-time… Read More
You are given a binary search tree (BST) and a value to insert into the tree. Print inorder traversal of the BST after the insertion.Example:… Read More
Given a BST and a number. The task is to check whether the given number is equal to the sum of all the node from… Read More
Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater… Read More
Given a binary tree and the two nodes say ‘a’ and ‘b’, determine whether two given nodes are cousins of each other or not.Two nodes… Read More
Given two binary trees, the task is to check whether the two binary trees is a mirror of each other or not.Mirror of a Binary… Read More
The array representation of a complete binary tree contains the data in sorted order. Which traversal of the tree will produce the data in sorted… Read More
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of… Read More
Consider the following C program segment struct CellNode {   struct CelINode *leftchild;   int element;   struct CelINode *rightChild; }    int Dosomething(struct CelINode *ptr) {     int… Read More
Which of the following cannot generate the full binary tree? (A) Inorder and Preorder (B) Inorder and Postorder (C) Preorder and Postorder (D) None of… Read More
Which of the following tree traversal uses a queue data structure? (A) Preorder (B) Inorder (C) Postorder (D) Level order Answer: (D) Explanation: Level order… Read More
Which traversal of tree resembles the breadth first search of the graph? (A) Preorder (B) Inorder (C) Postorder (D) Level order Answer: (D) Explanation: Breadth… Read More
Consider two binary operators ‘ ‘ and ‘‘ with the precedence of operator being lower than that of the operator. Operator is right associative while… Read More