Tree
containing points "Implementation and Operations on Binary Search Tree - Create, Insert, Delete, Search, Tree traversals– preorder, inorder, postorder (recursive implementation), Level-order traversal using a queue, Counting leaf, non-leaf and total nodes, Copy, Mirror."
Total Marks: 8
Part 1: Practical Questions (6 marks)
Question 1: Write a C program to create a binary search tree with the following elements: 5, 2, 8, 1, 4, 6, 10, 3, 7, and 9. (1 mark)
Question 2: Write a C function to insert an element in the binary search tree created in question 1. The function should take the root of the tree and the value to be inserted as input parameters. (1 mark)
Question 3: Write a C function to delete an element from the binary search tree created in question 1. The function should take the root of the tree and the value to be deleted as input parameters. (1 mark)
Question 4: Write a C function to search for an element in the binary search tree created in question 1. The function should take the root of the tree and the value to be searched as input parameters. (1 mark)
Question 5: Write a C function to count the number of leaf nodes in the binary search tree created in question 1. The function should take the root of the tree as an input parameter. (1 mark)
Question 6: Write a C function to perform a level-order traversal of the binary search tree created in question 1 using a queue. The function should take the root of the tree as an input parameter. (1 mark)
Part 2: Theoretical Questions (2 marks)
Question 7: Explain the concept of a binary search tree and its properties. (1 mark)
Question 8: Explain the difference between preorder, inorder, and postorder traversals in a binary search tree. (1 mark)
Marks distribution:
- Correct implementation of binary search tree creation: 1 mark
- Correct implementation of binary search tree insertion function: 1 mark
- Correct implementation of binary search tree deletion function: 1 mark
- Correct implementation of binary search tree search function: 1 mark
- Correct implementation of counting leaf nodes function: 1 mark
- Correct implementation of level-order traversal function: 1 mark
- Proper explanation of binary search tree and its properties: 1 mark
- Proper explanation of preorder, inorder, and postorder traversals: 1 mark
No comments:
Post a Comment