KEMBAR78
Stacks overview with its applications | PPT
Saqib Saeed Umair Maqbool Hassan tariq
 
Quick Introduction Stacks are linear lists. All deletions and insertions occur at one end of the stack known as the TOP. Data going into the stack first, leaves out last. Stacks are also known as LIFO data structures ( L ast- I n,  F irst- O ut).
Basic Stack Operations push – Adds an item to the top of a stack. pop – Removes an item from the top of the stack and returns it to the user. stack top (top, peek) – Copies the top item of the stack and returns it to the user; the item is not removed, hence the stack is not altered.
Additional Notes Stacks structures are usually implemented using arrays or linked lists. For both implementations, the running time is O(n). We will be examining common Stack Applications.
Stack Applications Reversing Data: We can use stacks to reverse data. (example: files, strings) Very useful for finding palindromes Converting Decimal to Binary Infix to postfix conversion
Backtracking Stacks can be used to backtrack to achieve certain goals. Usually, we set up backtrack tokens to indicate a backtrack opportunity. Backtracking  in N-Queen problem.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Stacks overview with its applications

  • 1.
    Saqib Saeed UmairMaqbool Hassan tariq
  • 2.
  • 3.
    Quick Introduction Stacksare linear lists. All deletions and insertions occur at one end of the stack known as the TOP. Data going into the stack first, leaves out last. Stacks are also known as LIFO data structures ( L ast- I n, F irst- O ut).
  • 4.
    Basic Stack Operationspush – Adds an item to the top of a stack. pop – Removes an item from the top of the stack and returns it to the user. stack top (top, peek) – Copies the top item of the stack and returns it to the user; the item is not removed, hence the stack is not altered.
  • 5.
    Additional Notes Stacksstructures are usually implemented using arrays or linked lists. For both implementations, the running time is O(n). We will be examining common Stack Applications.
  • 6.
    Stack Applications ReversingData: We can use stacks to reverse data. (example: files, strings) Very useful for finding palindromes Converting Decimal to Binary Infix to postfix conversion
  • 7.
    Backtracking Stacks canbe used to backtrack to achieve certain goals. Usually, we set up backtrack tokens to indicate a backtrack opportunity. Backtracking in N-Queen problem.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.