Ayush7-BIT / turbo-robot

"A collection of essential coding algorithms and popular code solutions. Optimized for interviews and competitive programming, covering a wide range of topics from sorting to dynamic programming.”
26 stars 277 forks source link

Implement Stacks using Linked Lists following the OOPS paradigm for coding #491

Open raxvab opened 1 month ago

raxvab commented 1 month ago

Implement Stacks using Linked Lists following the OOPS paradigm for coding

Description:

We need to implement a Stack data structure using a Linked List in Python, adhering to the Object-Oriented Programming (OOP) paradigm. The implementation should encapsulate the behavior of a stack and the operations it supports while leveraging the flexibility of linked lists for dynamic memory management.

Requirements:

Additional Guidelines:

Acceptance Criteria:

Example Usage:

stack = Stack()
stack.push(10)
stack.push(20)
stack.push(30)

print(stack.peek())  # Should output 30
print(stack.pop())   # Should remove and output 30
print(stack.pop())   # Should remove and output 20
print(stack.is_empty())  # Should return False

Resources:


raxvab commented 1 month ago

Hi @Ayush7-BIT I've raised one PR for this feature Create Stacks.py #492 Please merge this PR