## Disjoint Set Union on trees | Set 2

Given a tree, and the cost of a subtree is defined as |S|*AND(S) where |S| is the size of the subtree and AND(S) is bitwise… Read More »

Given a tree, and the cost of a subtree is defined as |S|*AND(S) where |S| is the size of the subtree and AND(S) is bitwise… Read More »

Given a tree and weights of nodes. Weights are non-negative integers. Task is to find maximum size of a subtree of a given tree such… Read More »

Given a binary tree, task is to find subtree with maximum sum in tree. Examples : Input : 1 / \ 2 3 / \… Read More »

Consider a node X in a Binary Tree. Given that X has two children, let Y be Inorder successor of X. Which of the following… Read More »

Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right sub stress, respectively, of node… Read More »

Postorder traversal of a given binary search tree, T produces the following sequence of keys 10, 9, 23, 22, 27, 25, 15, 50, 95, 60,… Read More »

A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is… Read More »

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a… Read More »

A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes… Read More »

A weight-balanced tree is a binary tree in which for each node. The number of nodes in the left sub tree is at least half… Read More »

The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is: (A) n/2 (B) (n-1)/3… Read More »

The maximum number of binary trees that can be formed with three unlabeled nodes is: (A) 1 (B) 5 (C) 4 (D) 3 Answer: (B)… Read More »

In a complete k-ary tree, every internal node has exactly k children or no child. The number of leaves in such a tree with n… Read More »

Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children… Read More »

What are the main applications of tree data structure? 1) Manipulate hierarchical data 2) Make information easy to search (see tree traversal). 3) Manipulate sorted… Read More »