![]() |
| Stack using Linked List Concept |
This assignment is designed for practicing Stack implementation in Python using the Singly Linked List concept. It helps students learn stack operations like push(), pop(), peek(), is_empty(), and size() with simple examples and Python code. This task improves your understanding of pointers, nodes, memory handling, and DSA concepts used in real programming.
Assignment 7 – Stack Basics in Python
Assignment 8 – Stack Operations in Python
Assignment-9: Stack using Linked List Concept
π§© Task 1: Create Stack Class
Define a class Stack to implement stack data structure using singly linked list concept.
Define an __init__() method to initialize start reference variable and item_count variable to keep track of number of elements in the stack.
π§© Task 2: Check if Stack is Empty
Define a method is_empty() to check if the stack is empty inside Stack class.
π§© Task 3: Add Element to Stack
In Stack class, define push() method to add data onto the stack.
π§© Task 4: Remove Top Element
In Stack class, define pop() method to remove the top element from the stack.
π§© Task 5: View Top Element
In Stack class, define peek() method to return the top element of the stack.
π§© Task 6: Find Stack Size
In Stack class, define size() method to return the size of the stack, i.e., number of items present in the stack.
Continue Learning:
More DSA assignments and Python projects coming soon!

No comments:
Post a Comment