0% found this document useful (0 votes)
4 views1 page

Data Structures for Hospital and App Systems

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Data Structures for Hospital and App Systems

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment 4:

Q1. A hospital management system needs to maintain a patient record list where patients can
be admitted, discharged, or transferred between wards at any time.
(a) Suggest whether a singly, circular, or doubly linked list would be the most suitable
data structure. Justify your answer with respect to insertion, deletion, and traversal.
(b) Identify at least two advantages and two disadvantages of using your chosen linked
list over the other two variants.

Q2. An online music playlist system allows users to add, delete, and reorder songs frequently.
(a) Discuss whether an array-based implementation or a linked list implementation
would be more efficient for such a system.
(b) Explain with two advantages and two disadvantages why your choice is more
suitable.
(c) In what scenario could the alternative (array) still be preferred?

Q3. A food delivery app uses a queue to handle customer orders and a stack to maintain the
history of navigation (back/forward).
(a) If these structures are implemented using arrays, what limitations may arise?
(b) Explain how using linked lists for stack and queue can solve these issues.
(c) Provide at least two situations where the array-based implementation would still be
better than linked list.

Q4. A compiler needs a stack for expression evaluation and function calls.
(a) Write the procedure for implementing PUSH and POP operations using a linear
array.
(b) Write the procedure for the same operations using a linked list.
(c) Compare both implementations in terms of memory usage, time complexity, and
overflow handling in this compiler scenario.

You might also like