A lab to implement a doubly linked list in ruby. Use the specs for node and list to implement a doubly linked list.
FIRST: Work on the node class and get the specs passing.
SECOND: For the list implementation, the methods should have a similar interface to ruby array. Here are the first methods you should implement:
- new (initialize)
- push
- pop
- length
THIRD: work on these methods:
- getIndex
- setIndex
- head
- tail
- shift
- unshift
- insert
- delete_at
LASTLY: if you have time, implement the following methods:
- reverse
- max
- min
- reduce
- each
- flatten
HINT: USE THE SPECS!! The specs will help you a lot. Make sure to run them and get them to pass for the first set of methods before you move on to the 2nd or 3rd set of methods.