Programming Algorithms and Data Structures-exam-Dec-2007
Programming Algorithms and Data Structures-exam-Dec-2007
Faculty of Science
Data Structures and Algorithms
BSc Gen, IT II & Dip CS Semester 1 Final Assessment 2007/2008
Date: 12/12/2007 Time 2.00-4.00pm
Instructions:
Answer any 10 (Ten) Questions
2. Briefly describe any four Data structures and four data structure operations. (4 Marks)
a. (K+L) – (Q-R)
b. (A/B)*C (4 Marks)
8. Give the difference between a queue, a priority queue and a dequeue. (4Marks)
9. Explain with examples the tree terms Copies and similar. (4 Marks)
10. Consider the following Queue of Products Where QUEUE is a circular array allocated 7
Memory cells
FRONT: 2
REAR : 4 QUEUE : _____, Sugar, Salt, Rice,______, ________, ________,
Describe the Queue as the following Operations take place
a. One Product is deleted
b. Two products Soap and Oil are added.
c. One product is deleted.
d. One more element is deleted (4Marks)
11. Consider the following deque of characters where DEQUE is a circular array allocated 6
memory locations
LEFT: 3
RIGHT: 3 DEQUE: ______, _______,H,_______,________,_______
12. Define and explain with a diagram the following tree terminologies.
a. Edge
b. Path
c. Leaf
d. Branch
e. Level Number
f. Depth of A tree. (4Marks)