A library for working with LIFO like data structures (stacks, queues).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Dominic Grimm 0bc58806c5
Update 'README.md'
7 months ago
.github/workflows init 1 year ago
spec init 1 year ago
src added to_a method 1 year ago
.editorconfig init 1 year ago
.gitignore init 1 year ago
LICENSE init 1 year ago
README.md Update 'README.md' 7 months ago
shard.yml added to_a method 1 year ago

README.md

lifo

GitHub release

A library for working with LIFO like data structures (stacks, queues).

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      lifo:
        git: https://git.dergrimm.net/dergrimm/lifo.git
    
  2. Run shards install

Usage

require "lifo"

stack = Lifo::Stack(String).new(3)
stack.push("Foo")
stack.push("Bar")
stack.push("Baz")

p! stack.pop
# stack.pop # => "Baz"
p! stack.pop
# stack.pop # => "Bar"
p! stack.peek
# stack.peek # => "Foo"

queue = Lifo::Queue(String).new(3)
queue.enqueue("John Doe")
queue.enqueue("Jane Doe")

p! queue.dequeue
# queue.dequeue # => "John Doe"
p! queue.peek
# queue.peek # => "Jane Doe"

Contributing

  1. Fork it (https://github.com/grimmigerFuchs/lifo/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors