Report on Data Structures in Python
Introduction
Data structures help organize and manage data efficiently. This report covers Linked List, Stack, Queue, and Dequeue,
along with their implementations, advantages, and disadvantages.
Linked List
A linear structure where elements (nodes) are linked using pointers. Types include Singly Linked List, Doubly Linked
List, and Circular Linked List.
Advantages:
- Dynamic memory allocation
- Efficient insertions/deletions
Disadvantages:
- No direct access to elements
- Extra memory for pointers.
Stack (LIFO - Last In, First Out)
A structure where the last element added is the first removed.
Advantages:
- Easy to implement
- Efficient for recursion and undo operations
Disadvantages:
- Limited access to elements
- Fixed size in array-based implementation.
Queue (FIFO - First In, First Out)
A structure where the first element added is the first removed.
Advantages:
- Maintains order
- Efficient for scheduling tasks
Disadvantages:
- Limited access to elements
- Requires resizing if full.
Dequeue (Double-Ended Queue)
Allows insertions and deletions from both ends.
Report on Data Structures in Python
Advantages:
- Highly flexible
- Useful for palindrome checking
Disadvantages:
- More complex than stack/queue
- Higher memory usage.
Conclusion
Each data structure serves different purposes. Choosing the right one ensures efficient programming. Understanding
their strengths and weaknesses is key to optimizing application performance.