Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 523 Bytes

README.md

File metadata and controls

9 lines (6 loc) · 523 Bytes

Linked List

This includes a class for a Stack, a Queue, and a LinkedListNode.

I created two methods that can both reverse the values in a linked list. The first one, reverse_list, does so by iterating through the original list and adding its values to the front of a new list. The new list will end up being the reverse of the original. The second method, reverse, involves using a stack instead.

Tests for Stack: stack_spec.rb Tests for Queue: queue_spec.rb Tests for reversing a linked-list: linked-list-node_spec.rb