Skip to content

Data Structures

CSE · Midterm · Fall 26

Section 71_C · Batch 71

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

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, Fall 2026 Course Code: CSE123, Course Title: Data Structure Level: 1 Term: 3 Batch: 71 Time: 01:30 Hrs Marks: 40 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. Mohtasim and Jinia were discussing the past year's performance of the leading footballers regarded as Ballon d'Or candidates. They have not fixed the number of players to be compared in advance; instead, the number of players, n, will be taken as input. The parameters of these n players over the past year will then be considered. Each player is to be represented as a node. Each node contains the following fields: • Name (string) • Club (string) • Goals (int) • Assists (int) • Trophies Won (int) • A pointer to the next node in the list Name | Club | Goal | Assist | Trophies | *next a) Write a C program using functions that creates a linked list of players, taking the value of each node's members as user input and gives all the information as output. [6, CO2] Input: The first line contains an integer n, the number of players being compared. Each of the next n lines describes one player, who is stored as a node in the list <name>, <club>, <goals>, <assist>, <trophies> Constraint: 1 < n < 100 [N.b: pointer *next must be manipulated by you to link the nodes] Sample Input | Sample Output 3 | Kane Bayern_Munich 73 8 3 Kane Bayern_Munich 73 8 3 | Yamal Barcelona 26 21 3 Yamal Barcelona 26 21 3 | Mbappe Real_Madrid 58 14 0 Mbappe Real_Madrid 58 14 0 | b) Mohtasim and Jinia then realized that they had not included Lionel Messi, arguably the greatest player of all time. Out of respect for him, they wish to add his node at the beginning of the linked list they created. Write a user-defined function that creates a new node and inserts it at the beginning of the linked list. [3] c) All the data were taken from the FBref website. However, they found that the number of goals entered for Mbappe through user input was incorrect. They now wish to locate Mbappe's node and update his goals to 60. Write a user-defined function to complete this task. [4] Hint: To identify Mbappé's node, you may use the built-in function strcmp() for c. 2. Soroj loves brackets. He was thinking by himself about different expressions with brackets. All of a sudden he thought of following complex expression: (8 + 3) * (12 - 4) \ 2 + 5 * (7 - 3) a) Convert the given infix expression into postfix notation using a stack. Show the stack contents and postfix expression after processing each operator and parenthesis. [3, CO1] b) Find the value of the postfix expression (from 2(a)) using a stack. Show the stack operations step by step and determine the final result. [3] 3. A University Student Service Management System is being developed to manage students requesting different services efficiently. The system must support the following operations: [2 + 4, CO1] 1. Students submit service requests (e.g., ID card collection, certificate collection, and transcript requests) and normally receive service in the order of arrival. 2. The service desk must process the most recently submitted request first when a staff member needs to undo the latest processing action. 3. The system should allow staff to view the next request waiting for service without removing it from the waiting list. 4. The system should allow staff to reverse the most recent processing action. 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 requests are registered, added to the waiting list, processed for service, and reversed using the appropriate data structure(s) and briefly describe.