List out some of the application of tree data structure?
Answer
- Manipulation of Arithmetic expression
- Symbol Table construction
- Syntax analysis
In a tree construction which is the suitable efficient data structures?
(a) Array
(b) Linked list
(c) Stack
(d) Queue
(e) None
Answer:
(b) Linked list
Problem 3
How many different trees are possible with 10 nodes?
Answer
In general If there are n nodes then there exist 2n-n different trees
here n=10
so 210-10==>1024-10=1014
So there are 1014 different possible trees available.
Problem 4
How many differnt trees are possible with 3 nodes and show the possible trees?
Answer
here n=3
2n-n=23-3=8-3=5
So a tree with 3 nodes have the maximum combination of 5 different trees.
The different possible trees are shown below
Problem 5
Consider the tree shown in figure
- Which node is the root node?
- Which nodes are Leaves?
- What is the depth of the tree?
- What is the degree of the tree?
- For each node in the tree
(B) List the children
(C) List the siblings
(D) Compute the depth
(E) Compute the height
Answer
Good work
ReplyDeleteknowlegeable work
ReplyDelete