0% found this document useful (0 votes)
21 views

Non Credited Lab: DSA (Binary Tree Array + Linked Implementation) BS F13-Aft, BIT F13

Uploaded by

Sadiq Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Non Credited Lab: DSA (Binary Tree Array + Linked Implementation) BS F13-Aft, BIT F13

Uploaded by

Sadiq Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

Non Credited Lab


- means no evaluation, just for practice, solution may be shared later
Task 1: Write level order traversal for linked implementation of binary search tree?
Task 2: Write function mirror to create mirror image of binary tree?
Task 3: Consider array implementation of binary tree. Write code declare an integer array to store a tree of
height 5. Store random values on all leaf nodes at last level. Write a recursive function sum to store sum of
child nodes at parent?

Task 4:
Find Complexity of following recursive functions:
𝑛
a. 𝑇(𝑛) = 2𝑇 ( 2) + 𝑐, 𝑇(1) = 𝑐
𝑛
b. 𝑇(𝑛) = 𝑇 (2 ) + 𝑛, 𝑇(1) = 𝑐
𝑛
c. 𝑇(𝑛) = 2𝑇 ( 4) + 𝑐, 𝑇(1) = 𝑐
d. 𝑇(𝑛) = 𝑇(𝑛 − 2) + 𝑐, 𝑇(0) = 𝑐

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

Resource Person: Abdul Mateen PUCIT-NC

You might also like