Data Structures
CSE · Midterm · Spring 26
Paper 1 of 3Batch 69 · Sumit SahaSwitch
Batch 69
Paper 1 of 3
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Faculty of Science & Information Technology
Department of Computer Science & Engineering
Midterm Examination, Spring 2026
Course Code: CSE 123, Course Title: Data Structure
Level: 1 Term: 3 Batch: 69
Time: 01:30 Hrs
Marks: 25
Answer ALL Questions
[The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.]
1. [Figure: A linked list diagram showing three nodes: Start pointing to the first node with fields P: phi, Q: 'A', R: 2; which points to the second node with fields P, Q: 'B', R: 5; which points to the third node with fields P, Q: 'C', R: 10, pointing to phi. The list is labeled Linked List Clear below.] CO2
a) Implement a C program using structure, pointers and dynamic memory allocation to create the above linked list (use your nickname as the common node name). Then, display all the information stored in the linked list. [4]
b) Write a C program to insert a new record (Q: 'D', R: 10) after the node having data part (Q = 'B') using function. [4]
c) Apply the knowledge of dynamic memory allocation, pointer, structure and write a C program to delete the node having data part (R = 5) from the linked list using function. [4]
2. A code syntax analyzer is being developed for a programming editor. Before compiling a program, the editor must ensure that all operators and operands are processed in the correct order. CO1
The analyzer internally converts expressions into a format that can be evaluated sequentially without considering operator precedence or brackets. To manage operators during conversion, the system uses a stack-based mechanism.
Expression: -^*+123+45/9-41
a) Demonstrate the process of converting the above expression into infix notation. [2]
b) Apply stack operations to convert the resulting infix expression into postfix notation. [3]
3. A Hospital Patient Management System is being developed to manage patient services efficiently. The system must support the following operations: [2+3] CO1
1. Patients register at the reception desk and are normally treated in the order of arrival.
2. Emergency patients must be treated before regular patients, regardless of arrival time.
3. Each patient is assigned a priority level based on medical condition.
4. The system should allow hospital staff to view the next patient to be treated at any time.
Based on the above requirements:
i. Identify the most appropriate data structure(s) to implement this system and explain your choice.
ii. Draw a conceptual diagram or flowchart showing how patients are:
- Registered
- Prioritized
- Sent for treatment
4. Match each real-life scenario with the most suitable data structure and also briefly explain your answer. [3] CO1
Scenario | Data Structure
Redo operation in a photo editing software | ?
Customers waiting in a bank service line | ?
Recently visited pages in a web browser | ?