# Data Structures Unit 5 Trees: Mastery with Key Questions and Answers AKTU

Providing Unit5 TREES Data Structures Important Questions with the solution – AKTU, Last year’s question paper with solutions, and many more study materials that will help students or bachelor’s exam

```Dudes 🤔.. You want more useful details regarding this subject. Please keep in mind this as well.

Important Questions For Data Structures:
*Unit-01     *Unit-02
*Unit-03    *Unit-04
*Unit-05    *Short-Q/Ans
*Question-Paper with solution 21-22 ```

## Q1. Define binary search tree. Create BST for the following data, show all steps: 20, 10, 25, 5, 15, 22, 30, 3, 14, 13

Ans. Binary search tree:

• 1. A binary search tree is a binary tree.
• 2. Binary search tree can be represented by a linked data structure in which each node is an object.
• 3. In addition to a key field, each node contains fields left, right and P, which point to the nodes corresponding to its left child, its right child and its parent respectively.
• 4. A non-empty binary search tree satisfies the following properties:
• a. Every element has a key (or value) and no two elements have the same value.
• b. The keys, if any, in the left subtree of root are smaller than the key in the node.
• c. The keys, if any in the right subtree of the root are larger than the keys in the node.
• d. The left and right subtrees of the root are also binary search tree.

## Q2. Construct a binary tree for the following :

Inorder: Q, B, K, C, F, A, G, P, E, D, H, R

Preorder: G, B, Q,A, C, K, F, P, D, E, R, H

Find the postorder of the tree.

Ans.

## Q3. Draw a binary tree with The following traversal:

Inorder: D B H E A I F J C G

Preorder: A B D E H C F I J G

Ans.

## Q4. Draw a binary tree with following traversals

Inorder: B C A E G D H F I J

Preorder: A B C D E F G H I J

Ans.

## Q5. What is a threaded binary tree ? Explain the advantages of using a threaded binary tree.

Ans. Threaded binary tree is a binary tree in which all left child pointers that are NULL points to its inorder predecessor and all right child pointers that are NULL points to its inorder successor.

• 1. In threaded binary tree the traversal operations are very fast.
• 2. In thre aded binary tree, we do not require stack to determine the predecessor and successor node.
• 3. In a threaded binary tree, one can move in any direction i.e., upward or downward because nodes are circularly linked.
• 4.Insertion into and deletions from a threaded tree are all although time consuming operations but these are very easy to implement.

Ans.