DS MID-1 (2 marks)
DS MID-1 (2 marks)
A linked list is a linear data structure where elements (called nodes) are connected using pointers.
Each node contains two parts:
o Data (stores the actual value)
o A pointer (stores the address of the next node)
Unlike arrays, linked lists allow dynamic memory allocation and efficient insertion/deletion.
This allows traversal in both directions and makes insertion and deletion operations more
efficient than a singly linked list.
This ensures that the list never terminates and allows continuous traversal.
An Abstract Data Type (ADT) is a mathematical model for data structures, defining what
operations can be performed but not how they are implemented.
• Example: Stack ADT supports operations like push(), pop(), and isEmpty() without
specifying implementation details.
Example Structure:
Little Omega (ω) notation describes a lower bound that is not asymptotically tight.
• It represents functions that grow faster than a given function but without an exact
bound.
• Example: f(n) = ω(g(n)) means f(n) grows strictly faster than g(n), but not
necessarily at the same rate.
f. Compare Arrays and Linked Lists.
A Circular Linked List (CLL) is a linked list where the last node connects back to the first
node.
• Singly Circular Linked List – The last node points to the first node.
• Doubly Circular Linked List – Both first and last nodes are interconnected.
Elements of an array can be accessed using indexing, where indices start from 0.
Stored as: 1, 2, 3, 4
Stored as: 1, 3, 2, 4
n. What is Searching?
o. Define Sorting.