Assignment 4 Question
Assignment 4 Question
Islamabad Campus
Department of Computer Science
Instructions:
1. Try to get the concepts, consolidate your concepts and ideas from these questions
2. You should concern recommended books for clarify your concepts as handouts are not
sufficient.
3. Try to make solution by yourself and protect your work from other students. If I found
the solution files of some students are same then I will reward zero marks to all those
students.
4. Deadline for this assignment is 23-5-2025. This deadline will not be extended.
Question #5 2marks
1)Design a binary search tree for the following elements: 20, 10, 30, 5, 15, 25, 35. Perform an in-order
traversal.
2)Write the pre-order, in-order, and post-order traversals of the following tree
4)Given a tree with the following adjacency list, determine if it is a binary tree.
5)If a binary tree has 15 nodes, what is the minimum and maximum possible height of the tree?
6)Given a tree with degree constraints, how many distinct trees can you form with nnn nodes?
7)Prove that a tree is a connected graph with no cycles.
8)Can a tree contain a cycle? Why or why not?
9)What is the significance of leaf nodes in different types of trees (e.g., binary trees, spanning trees)?