Author: brendanbondurant
-

Includes & Find
These are the last two methods I’ll probably write about in this linked list series. You know the drill by now, so here are the tests (I’m giving you all of them at once, apologies for the big code block) Alright, so there are quite a few edge cases for find, so we will start…
-

pop & shift
Implementing pop and shift for a linked list, and testing both against empty and single-element lists.
-

insert into linked list
Writing an insert method for a linked list, with a prepend option and error handling for invalid positions.
-

-

Prepend – LinkedList
Adding a prepend method to a linked list so items can be added at the start, not just the end.
-

Linked List to String
Writing a stringify method that turns a linked list’s nodes into a readable string, including the empty-list case.
-

Count a Linked List
Writing a count method for a linked list, then hardening it to handle empty lists without breaking.
-

Linked List – Append
Building an append method for a linked list with test-driven development, so new nodes link on without overwriting existing ones.
-

Linked List Class
Starting a Linked List class in Ruby: the empty? method, a nil head, and the tests that check both.
-

Linked Lists
Revisiting an old linked list project before mod3: setting up the Node class and writing tests with RSpec.