You are on page 1of 1

DSA LAB 12 (Binary Tree Array + Linked Implementation + Recursion) BS F13-Aft, BIT F13

Non Credited Lab


- means no evaluation, just for practice, solution may be shared later
Task 1: Write destructor for BST Linked implementation?
Task 2: Write recursive function to delete leaf nodes only?
Task 3: Write function to count leaf nodes, parents having single child and parents having two children? Note:
You may all of them separately
Task 4: Write member function toArray for Binary Search Tree. Function will receive array as parameter and
populate array such that array will contain sorted data?
Task 5: Write level order traversal of Binary Tree such that output should look like tree?
Idea:
 First of all try to print nodes at each level on different lines
 Secondly create a function printSpaces having n as parameter, call this function with a value 40 at start
and decrease this value in each step
 Lastly handle none values by printing spaces

***************** Binary Tree + Recursion **************

Resource Person: Abdul Mateen PUCIT-NC

You might also like