Professional Documents
Culture Documents
Chandigarh University
Chandigarh University
WORKSHEET 1.1
1. Aim: To implement the concept of Arrays, Queues, Stack and Linked List.
2. Objective: Understand the problem and find out a better approach to solve a particular
problem.
if i == current_max:
# We need to jump
current_max = farthest
jumps += 1
if current_max >= n - 1:
break # Reached the end
return jumps
return head
5. Learning Outcomes:
Arrays:
Memory is allocated in consecutive blocks.
Efficiency of random access.
Knowledge of static and dynamic arrays.
Queue:
The First-In-First-Out (FIFO) principle applies to queues.
Queue operations: add, remove, rearrange.
Stack:
The Last-In-First-Out (LIFO) principle applies to stacks.
Push and pop operations in stacks.
Linked Lists:
Memory allocation with nodes that is dynamic.
Lists with one versus two connected pairs.
Insertion and deletion in linked lists.
Manipulation, reversal, and traversal.