/session-13-stack-tdd

Academy session 13 week 4 - create a stack using tdd

Primary LanguageRuby

What do you know about stacks?

  • It's like a list
    • like a todo list
    • can put things in
    • can take things out (and deal with them)
    • it can be empty - when it's empty, you're done.
  • It's like an array
    • "push" is like <<
    • other operations to take data out - "pop"
    • "peek" looks to see what the next thing you WOULD pop is if you popped.
  • English-y 'stack'
    • things are piled up on top of each other
    • things that are added go on 'top'
    • also, you take things off from the top
    • "FILO" - First In Last Out
      • there is an order.
  • There's another data structure that uses FIFO - First In, First Out
    • "queue"

this is an example of a 'data structure'

  • these are tools
  • an array is a simple example
  • a ds holds data
  • don't code your own except for practice & in interviews. <-- general rule