Tag: Linked Lists
-

Linked List
I have pretty much covered the linked list, at least for now. I know there is more stuff to add. This was interesting to revisit, and I started at the beginning of mod3 and am finishing it in mod4. Going through this, there are some things I would definitely change, but this is an interesting…
-

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.