May 2025
Contents
The questions below are the paper as the University of Mumbai set it at the May 2025 examination, in the order it was set.
MarksPage
MarksPage
The Paper as Set
The questions in this volume are the questions asked at the May 2025 examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.
Duration 2 hours · Total marks 60 · 16 questions answered
How to use this volume
Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.
1
Q.1
Attempt any THREE · 15 Marks
aExplain linear and nonlinear data structures with suitable examples.[5]
Answer
For full marks, cover: what a data structure is, the meaning of linear and nonlinear, at least two examples of each with how they are arranged, a comparison table, and where each kind is used.
What a data structure is
A data structure is a way of storing and arranging data in memory so that it can be used well. The choice of structure decides how fast we can insert, delete, search and visit the data. Data structures are grouped by how their elements are arranged: in a line, or not in a line.
Linear data structures
In a linear data structure, the elements form a sequence. Each element has one element before it and one after it, except the first and the last. The elements can be visited one after another in a single pass.
- Array. A fixed number of elements of the same type, stored side by side in memory. Any element is reached at once by its index, as in
marks[3]. - Linked list. A chain of nodes. Each node holds data and the address of the next node.
- Stack. A list in which insertion and deletion take place at one end only, the top. It works Last In, First Out (LIFO), like a pile of plates.
- Queue. A list with insertion at the rear and deletion at the front. It works First In, First Out (FIFO), like a line at a ticket window.
Nonlinear data structures
In a nonlinear data structure, the elements are not in a sequence. One element may be linked to many others. So the elements cannot all be visited in one straight pass.
- Tree. A hierarchy of nodes. There is one root at the top, and each node may have children below it. A folder that holds folders and files is a tree.
- Graph. A set of vertices joined by edges, with no fixed top. A road map, with cities as vertices and roads as edges, is a graph.
Comparison
| Point | Linear | Nonlinear |
|---|---|---|
| Arrangement | in a sequence | in a hierarchy or a network |
| Neighbours of an element | at most one before and one after | can be many |
| Point | Linear | Nonlinear |
|---|---|---|
| Visiting all elements | one pass from start to end | needs a traversal method, such as inorder or breadth first |
| Levels | a single level | many levels |
| Ease of use | simple to build and use | harder, but models real links better |
| Examples | array, linked list, stack, queue | tree, graph |
| Typical use | lists of marks, undo in an editor, print jobs | file systems, family trees, maps, networks |
Conclusion. A linear data structure keeps its elements in a sequence, as in arrays, linked lists, stacks and queues. A nonlinear data structure links an element to many others, as in trees and graphs. Linear structures are simpler, while nonlinear ones show hierarchies and networks.
The rest of the answers
You have read the paper as it was set and its first answer in full.
Every other answer, in every solved paper of this semester, opens with the solved papers.
Already bought it? Sign in and it opens.
What should we fix or add?
Found an error in this volume? Report it and we will check it against the paper.
Tip: use the left and right arrow keys to turn papers.