Thursday, December 4, 2025

DSA Assignment-11: Stack Implementation by extending Singly Linked List

Follow me 



Assignment - 9

Assignment - 10


Implementation of Stack data structure in Python using Singly Linked List with methods like push, pop, peek, size, and is_empty in an inherited class.


Task 1: Import Singly Linked List Module

Import the module containing Singly Linked List (SLL) code into your Python file.

Task 2: Create Stack Class

Define a class Stack that inherits from SLL class.

Task 3: is_empty() Method

Define is_empty() method in Stack class to check if the stack is empty.

Task 4: push() Method

Define push() method in Stack class to add data onto the stack.

Task 5: pop() Method

Define pop() method in Stack class to remove the top element from the stack.

Task 6: peek() Method

Define peek() method to return the top element of the stack without removing it.

Task 7: size() Method

Define size() method to return the number of elements present in the stack.


This assignment successfully demonstrates how to implement the Stack data structure by extending the Singly Linked List class in Python. The stack operations such as push, pop, peek, size, and is_empty are performed efficiently using linked list concepts, ensuring proper use of inheritance and dynamic memory handling.

Friday, November 28, 2025

DSA using Python: Assignment - 10: Stack using Linked List in Python

Follow me

Stack using Linked List diagram in Python DSA


Assignment - 8

Assignment - 9


In Data Structures using Python, stack is a linear data structure that follows LIFO (Last In First Out) order. Here, we will implement stack using Linked List concept with methods like push(), pop(), peek(), size() and is_empty(). This is also part of DSA Assignment 10 for Python students.


Task 1 – Import Linked List Module
  1. Import module containing singly linked list code in your python file.
Task 2 – Create Stack Class
  1. Define a class Stack to implement stack data structure. Define \_\_init\_\_() method to create Singly Linked List (SLL) object.
Task 3 – Check If Stack is Empty
  1. Define a method is\_empty() to check if the stack is empty in Stack class.
Task 4 – Add Element in Stack
  1. In Stack class, define push() method to add data onto the stack.
Task 5 – Remove Element from Stack
  1. In Stack class, define pop() method to remove top element from the stack.
Task 6 – Return Top Element
  1. In Stack class, define peek() method to return top element on the stack.
Task 7 – Return Stack Size
  1. In Stack class, define size() method to return size of the stack that is number of items present in the stack.

✔ Works on LIFO principle  
✔ Constant time complexity O(1) for push & pop  
✔ Best for dynamic stack implementation  


This was the complete implementation of Stack using Linked List in Python with all major operations. Students can use this code for their DSA Assignment 10 and improve Python skills.

Monday, November 24, 2025

DSA Using Python – Assignment 9: Stack Implementation with Programs

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!

Friday, October 24, 2025

➡️DSA using Python: Assignment-8: Stack Extending List

Follow me

This assignment is designed for practicing Stack implementation using Python by extending the built-in list class. It helps you learn how to create a custom stack data structure with essential methods like push(), pop(), peek(), is_empty(), and size(), and how to restrict certain list methods to maintain stack behavior.

Assignment-8: Stack Extending List


🧱 Task 1: Create Stack Class

Define a class Stack to implement stack data structure by extending list class.

🧱 Task 2: Check if Stack is Empty

Define a method is_empty() to check if the stack is empty in 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 top element from the stack.

🧱 Task 5: View Top Element

In Stack class, define peek() method to return top element on the stack.

🧱 Task 6: Find Stack Size

In Stack class, define size() method to return size of the stack that is number of items present in the stack.

🧱 Task 7: Restrict Unwanted List Methods

Implement a way to restrict use of insert() method of list class from stack object.

Thursday, October 23, 2025

DSA using Python: Assignment-7: Stack using list

Stack Using List


This assignment is for practice, focusing on implementing a Stack using Python lists. It covers key stack operations like push, pop, peek, is_empty, and size, following the LIFO principle. This helps in understanding stack behavior and list-based implementation in Python.

Assignment-7: Stack using list


Task 1: Define Stack class with init()
Define a class Stack to implement stack data structure using list. Define __init__() method to create an empty list object as instance object member of Stack.

Task 2: Define is_empty() method
Define a method is_empty() to check if the stack is empty in Stack class.

Task 3: Define push() method
In Stack class, define push() method to add data onto the stack.

Task 4: Define pop() method
In Stack class, define pop() method to remove top element from the stack.

Task 5: Define peek() method
In Stack class, define peek() method to return top element on the stack.

Task 6: Define size() method
In Stack class, define size() method to return size of the stack that is number of items present in the stack.

Wednesday, September 24, 2025

DSA using Python: Assignment-6: Circular Doubly Linked List


This assignment focuses on implementing a Circular Doubly Linked List (CDLL) using Python. A CDLL is a data structure where each node contains references to both the previous and next nodes, and the list forms a closed loop. The assignment includes methods for insertion, deletion, searching, and traversal, demonstrating efficient manipulation of linked data in both forward and backward directions.

Assignment-6: Circular Doubly Linked List

πŸ”Ή Task 1: Define Node class
Define a class Node to describe a node of a circular doubly linked list.

πŸ”Ή Task 2: Define CDLL class with __init__() and is_empty()
Define a class CDLL to implement Circular Doubly Linked List with \_\_init\_\_() method to create and initialise last reference variable.

πŸ”Ή Task 3: Define is_empty() Method
Define a method is\_empty() to check if the linked list is empty in CDLL class.

πŸ”Ή Task 4: insert_at_start()
In class CDLL, define a method insert\_at\_start() to insert an element at the starting of the list.

πŸ”Ή Task 5: insert_at_last()
In class CDLL, define a method insert\_at\_last() to insert an element at the end of the list.

πŸ”Ή Task 6: search()
In class CDLL, define a method search() to find the node with specified element value.

πŸ”Ή Task 7: insert_after()
In class CDLL, define a method insert\_after() to insert a new node after a given node of the list.

πŸ”Ή Task 8: display()
In class CDLL, define a method to print all the elements of the list.

πŸ”Ή Task 9: Implement __iter__()
In class CDLL, implement iterator for CDLL to access all the elements of the list in a sequence.

πŸ”Ή Task 10: delete_first()
In class CDLL, define a method delete\_first() to delete first element from the list.

πŸ”Ή Task 11: delete_last()
In class CDLL, define a method delete\_last() to delete last element from the list.

πŸ”Ή Task 12: delete_item()
In class CDLL, define a method delete\_item() to delete specified element from the list.

Sunday, August 31, 2025

πŸ“™Software Engineer at Google Book

Follow me

 πŸŒ Explore the Journey of a Software Engineer at Google πŸš€  



If you are passionate about coding, problem-solving, and building scalable applications, then this book is a must-read for you.  

"Software Engineer at Google" provides deep insights into how one of the world’s biggest tech companies works, how engineers solve complex challenges, and how you can sharpen your own skills.  


πŸ“– What you will learn:  

✔️ Real-world engineering practices  

✔️ Problem-solving techniques  

✔️ Best coding principles  

✔️ Inspiration from Google’s work culture  


πŸ”— Click below to download and start your learning journey today:  

πŸ‘‰ [Download Software Engineer at Google Book]

DSA Assignment-11: Stack Implementation by extending Singly Linked List

Follow me   Assignment - 9 Assignment - 10 Implementation of Stack data structure in Python using Singly Linked List with methods like push,...