data structures in python - for app
data structures in python - for app
1. Reversing a word/Line.
2. Undo Mechanism in Text Editors.
3. Using in recursion.
4. Stack application in backtracking. Backtracking is used in a large number of puzzles games like
Sudoku.
5. <html> code
Underflow: It refers to situation when one tries to pop/delete an item from an empty stack or queue.
Example:
List=[]
List.pop()
What is Peek: Get the top data element of the stack, without removing it.
We can do this by: list[-1].
Steps algorithm for Push Operations:
Steps 1: Checks if the stack is full.
Steps 2: If stack is full, produce an error and exit.
Steps 3: If stack is not full, Add an element in stack using append().
Steps 4: Then Access the List or Stack.
Steps for algorithm Pop Operations:
Steps 1: Checks if the stack is empty.
Steps 2: If stack is empty, produce an error and exit.
Steps 3: But If stack is not empty, Then delete top element of stack using pop().
Steps 4: Then Access the List or Stack.