Friday, October 24, 2025

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

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

 πŸŒ 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]

Wednesday, August 20, 2025

DSA using Python: Assignment-5: Circular Linked List



Learn how to implement Circular Linked List in Python step by step. This assignment covers Node and CLL classes, insertion, deletion, searching, and iteration with clear examples for better understanding of Data Structures and Algorithms using Python.

Assignment-5: Circular Linked List

### ✅ Task 1: Define Node class

1. Define a class Node to describe a node of a circular linked list.

### ✅ Task 2: Define CLL class

2. Define a class CLL to implement Circular Linked List with __init__() method to create and initialise last reference variable.

### ✅ Task 3: is_empty()

3. Define a method is_empty() to check if the linked list is empty in CLL class.

### ✅ Task 4: insert_at_start()

4. In class CLL, define a method insert_at_start() to insert an element at the starting of the list.

### ✅ Task 5: insert_at_last()

5. In class CLL, define a method insert_at_last() to insert an element at the end of the list.

### ✅ Task 6: search()

6. In class CLL, define a method search() to find the node with specified element value.

### ✅ Task 7: insert_after()

7. In class CLL, define a method insert_after() to insert a new node after a given node of the list.

### ✅ Task 8: print_all()

8. In class CLL, define a method to print all the elements of the list.

### ✅ Task 9: Iterator

9. In class CLL, implement iterator for CLL to access all the elements of the list in a sequence.

### ✅ Task 10: delete_first()

10. In class CLL, define a method delete_first() to delete first element from the list. 

### ✅ Task 11: delete_last()

11. In class CLL, define a method delete_last() to delete last element from the list.

### ✅ Task 12: delete_item()

12. In class CLL, define a method delete_item() to delete specified element from the list.

Wednesday, August 13, 2025

DSA using Python: Assignment-4: Doubly Linked List



In this assignment, we implement a Doubly Linked List (DLL) using Python.  

A DLL is a data structure where each node contains:

- **data** (the value)

- **next** pointer (link to next node)

- **prev** pointer (link to previous node)


It allows traversal in both directions, making insertion and deletion more flexible than a singly linked list.



Assignment-4: Doubly Linked List


### ✅ Task 1: Define Node class

1. Define a class Node to describe a node of a doubly linked list.


### ✅ Task 2: Define DLL class

2. Define a class DLL to implement Doubly Linked List with __init__() method to create and initialise start reference variable.


### ✅ Task 3: is_empty()

3. Define a method is empty() to check if the linked list is empty in DLL class.


### ✅ Task 4: insert_at_start()

4. In class DLL, define a method insert_at_start() to insert an element at the starting of the list.


### ✅ Task 5: insert_at_last()

5. In class DLL, define a method insert_at_last() to insert an element at the end of the list.


### ✅ Task 6: search()

6. In class DLL, define a method search() to find the node with specified element value.


### ✅ Task 7: insert_after()

7. In class DLL, define a method insert_after() to insert a new node after a given node of the list.


### ✅ Task 8: print_all()

8. In class DLL, define a method to print all the elements of the list.


### ✅ Task 9: Iterator

9. In class DLL, implement iterator for DLL to access all the elements of the list in a sequence.


### ✅ Task 10: delete_first()

10. In class DLL, define a method delete_first() to delete first element from the list. 


### ✅ Task 11: delete_last()

11. In class DLL, define a method delete_last() to delete last element from the list.


### ✅ Task 12: delete_item()

12. In class DLL, define a method delete_item() to delete specified element from the list.


A Doubly Linked List gives more flexibility compared to a Singly Linked List as we can traverse in both directions.  

This assignment builds understanding of bidirectional linking and efficient insertion/deletion operations.


Thursday, August 7, 2025

DSA using Python: Assignment 3 – Singly Linked List (SLL)



About Singly Linked List

In this assignment, we implement a Singly Linked List (SLL) using Python. We build the structure using classes, define insertion and deletion operations, and also add methods for searching and iterating over the list. This is a fundamental concept in Data Structures and Algorithms (DSA).


Assignment 3 – Singly Linked List (SLL)

### ✅ Task 1: Define Node Class
Define a class `Node` to describe a node of a singly linked list.

### ✅ Task 2: Define SLL Class
Implement `__init__()` method to create and initialise the `start` reference variable.

### ✅ Task 3: is_empty()
Method to check if the list is empty.

### ✅ Task 4: insert_at_start()
Insert element at the **start** of the list.

### ✅ Task 5: insert_at_last()
Insert element at the **end** of the list.

### ✅ Task 6: search()
Search for a node with a given value.

### ✅ Task 7: insert_after()
Insert new node after a given node.

### ✅ Task 8: print_all()
Print all elements of the list.

### ✅ Task 9: Iterator
Implement an iterator to access all elements in a sequence.

### ✅ Task 10: delete_first()
Delete the **first** node.

### ✅ Task 11: delete_last()
Delete the **last** node.

### ✅ Task 12: delete_item()
Delete a node with specific value.


This assignment helped in building the core structure of singly linked lists in Python. Understanding how to create nodes and link them using a class-based approach is essential for real-world linked list problems in coding interviews and DSA practice.


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

This assignment is designed for practicing Stack implementation using Python by extending the built-in list class. It helps you learn how ...