/build_you_a_list_ruby

Implement your own Ruby list from scratch

Primary LanguageRuby

Build you a list

This is an exercise to better understand collection data structures, particularly lists.

Setup

  1. Fork the repo
  2. Clone to your local machine
  3. Run bundle install to set up dependencies

Exercise

Run the test suite with rspec spec/list_spec.rb. There is a skeleton List class under lib/list.rb. Make the necessary change to that file to get the test suite to pass. Once you do you'll have implemented your own rudimentary linked list!

Don't use any of the collection data structures from Ruby. That means no Array, Hash, Set, etc. The goal here is to make your own from scratch.

Feel free to use all the fancy Ruby tricks you want. You can add more methods to List, introduce other supporting objects, or even go wild with metaprogramming. The goal here is to explore what you can do with just raw Ruby at your disposal.