## Insert a node in Binary Search Tree Iteratively

A recursive approach to insert a new node in a BST is already discussed in the post: Binary Search Tree | SET 1. In this… Read More »

## Root to leaf path sum equal to a given number in BST

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 »

## Smallest number in BST which is greater than or equal to N ( Iterative Approach)

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 »

## Check if two nodes are cousins in a Binary Tree | Set-2

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… Read More »

## Check if two trees are mirror of each other using level order traversal

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… Read More »

## Data Structures | Tree Traversals | Question 12

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 »

## Data Structures | Tree Traversals | Question 11

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 »

## Data Structures | Tree Traversals | Question 10

Consider the following C program segment filter_none edit close play_arrow link brightness_4 code struct CellNode {   struct CelINode *leftchild;   int element;   struct CelINode *rightChild; }… Read More »

## Data Structures | Tree Traversals | Question 9

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 »

## Data Structures | Tree Traversals | Question 8

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 »

## Data Structures | Tree Traversals | Question 7

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 »

## Data Structures | Tree Traversals | Question 6

Consider two binary operators ‘ ‘ and ‘‘ with the precedence of operator being lower than that of the operator. Operator is right associative while… Read More »

## Data Structures | Tree Traversals | Question 5

Which of the following pairs of traversals is not sufficient to build a binary tree from the given traversals? (A) Preorder and Inorder (B) Preorder… Read More »

## Data Structures | Tree Traversals | Question 4

What does the following function do for a given binary tree? filter_none edit close play_arrow link brightness_4 code int fun(struct node *root) {    if (root… Read More »

## Data Structures | Tree Traversals | Question 3

The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g,… Read More »