Mastering data structures in Ruby — Stacks

Stacks are a special kind of linked lists that allow us to efficiently store retrieve data in last in, first out order (LIFO). Or in other words, elements are retrieved in the opposite order they were stored on the stack.As well as it happens with queues, stacks won’t allow us to insert/remove elements at random locations, and just like queues, they are no more than sequences of connected nodes.Stack-based virtual machines like YARV (Ruby’s virtual machine) use stacks to store and eval bytecode instructions.Let’s see the way a stack grows as we store (push) items onto it.
Mastering data structures in Ruby — Stacks #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/mastering-data-structures-in-ruby-stacks

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles