Assignment # 02 DSA
Assignment # 02 DSA
Note:
- Answer the following questions.
- This assignment covers CLO: 01 of the course.
Q1
What are LIFO and FIFO data structures? Explain both LIFO and FIFO taking help of some
real-life examples along with their uses in computer programs.
Q2
What is the most effective way to implement a priority queue? Create a C++ program that
implements priority queues using the most effective method.
Q3
Q4
Write a C++ program that creates a binary tree T in memory. Write non-recursive C++
functions in that program for each of the following:
a) Finding the number of nodes in T.
b) Finding the depth D of T.
c) Finding the number of terminal nodes in T.
d) Deletes all the terminal nodes in T