QB M3M4
QB M3M4
2. Write C functions to (i) delete a node from doubly linked list from the front. (ii) Concatenate two linked
lists.
4. Show the diagrammatic linked representation for the following sparse matrix.
0 1 0 0
0 0 2 0
5 0 0 7
0 4 0 0
6. Write recursive C functions for inorder, preorder and postorder traversals of a binary tree. Also, find all
the traversals for the given tree.
7. Define Binary tree. Explain the array and linked representations of a binary tree with a suitable example.
8. What is a circular linked list? Write a C Program to create a circular linked list.
10. Explain the algorithm for iterative inorder traversal of a binary tree with an example. Show the stack
contents at each step.
11. With suitable examples, define
(i) Degree of a node (ii) Level of a binary tree (iii) Complete binary tree (iv) Full binary
tree
12. What is level order traversing of a binary tree? Explain with an example tree and show the contents of
queue at each step.
13. What is a Threaded Binary Tree (TBT)? State the rules to construct TBT. Construct TBT for the
following binary tree and show the threads.
14. Why are Threaded Binary Trees (TBT) required? Give the structure for TBT. Differentiate between
TBT and normal binary tree.
15. How is the problem of loose (dangling) threads handled in Threaded Binary Tree. Explain with an
example tree.
16. Explain the procedure for inorder traversal of TBT along with an example tree.
17. How do you insert a node into TBT? Explain the procedure with an example tree.
18. Represent the polynomial using a structure. Explain the algorithm with an example to add two
polynomials along linked list representation for POLY1, POLY2 and POLYSUM polynomials.
20. Write the recursive and iterative functions to search a key in BST. Analyse their performance in terms
of time and space complexity.
21. Explain the entire deletion process (leaf node, node with one child and node with both children) in BST
with examples.
23. Construct BST for the given set of numbers: 14,15,4,9,7,18,3,5,16,20. Show the and steps and
intermediate trees. Also perform inorder, preorder and postorder traversals of the resultant tree.
24. Define the following (i) Selection tree (ii) Winner tree and (iii) Looser tree.
25. Form the looser tree and find out the winner of the tournament for the following runs.
27. Build the binary tree step by step for the following traversal sequences:
Inorder: E A C K F H D B G
Preorder: F A E K C D H G B
Also perform postorder traversal of the resultant tree.
28. For a Binary tree, Prove that n0 = n2 + 1 where n0 is the number of leaf nodes and n2 is the number of
nodes with degree 2.
29. What is a graph? Explain directed and undirected graph with an example for each.
30. Explain the adjacency matrix and adjacency list representation for the graph with examples.