Basic-Python-Programs icon indicating copy to clipboard operation
Basic-Python-Programs copied to clipboard

Add Stack Datastructure with user input

Open Bhakti23-CE opened this issue 1 year ago • 0 comments

###Summary: This PR introduces a new Python program that implements a stack class with various operations, allowing user interaction.

###Features added: Stack class with methods:

  • push: Pushes an item onto stack.
  • pop: Pop the top item of the stack and handle empty stack case.
  • peek: Returns the top element of stack without removing and checks if stack is empty.
  • is_empty: Checks if the stack is empty.
  • size: Returns the current size of the stack.
  • print_stack: Prints the elements present in stack.

Main Function:

  • Provides menu with options to perform stack operations.
  • Handles invalid inputs.

Bhakti23-CE avatar Nov 10 '24 09:11 Bhakti23-CE