DSA Assignment
DSA Assignment
Instructions:
Solution must be Hand Written and submitted in form of Hardcopy otherwise not accepted.
Assignment must be submitted in Group (4 max.). Each student has to solved his/her question and
write the roll number on that question.
Late Submissions will not be acknowledged.
Q1) Define a data structure and explain its importance in software engineering with an example
from real-world applications.
Q2) How do linear and non-linear data structures differ? Illustrate your answer with real-life
scenarios for both.
3 16 -1 0 8 7 1 55 -3 1
Q4) Find where the elements of an array LA are stored, if the base address of LA is 320 & LB =
0. Assume that int(s) are stored in 4 bytes and double(s) in 8 bytes.
a. double LA[12]
b. double LA[3]
c. int LA[26]
d. int LA[2]
Q5) Consider a stack having memory cells N = 5. Initially the stack has Murree and
Lahore in it. Applies the following operations on the stack.
a. Push (Karachi, Islamabad and Faisalabad).
b. Pop ()
c. Push (Narran, Rawalpindi)
d. Pop ()
Q6) Consider a QUEUE having memory cells N = 5. Initially the queue is empty. Perform
the following operations and update the values of Front and Rear.
Q7) Implement Binary Expression Tree for the following equation. Also traverse the tree by Pre-
Order, Post-Order and In-order manner.
((2 + 5) / 3) – (3 + 8)
Q8) Developed a tree from the following number by applying Binary Search Tree (BST)
technique. Show each step.
10,14,34,1,0,12 ,4,56,7,8