Tag: LinkedList
-
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…
-
insert into linked list
The post outlines the implementation of an insert method for a Linked List. It emphasizes writing tests to ensure functionality and error handling when inserting elements. The method includes a prepend option for inserting at the start and ensures valid locations by raising errors when necessary. The process culminates in successfully adding new nodes.
-
Prepend – LinkedList
The post discusses implementing a “prepend” method for a linked list, allowing items to be added at the beginning. It begins with tests for appending items and then fails to recognize “prepend” as a method. The author details the implementation and confirms that the tests pass successfully after defining the method.
-
Linked List to String
The post discusses the implementation of a “stringify” method for a LinkedList class, allowing the conversion of node data into a string. Initial tests are conducted to ensure it functions for single and multiple data points, leading to code modifications for proper formatting and handling of empty lists.
-
Linked Lists
In preparation for mod3, the author revisits an earlier linked list project, finding it less challenging after completing mod2. They focus on documentation and test-driven development using RSpec, outlining steps to create a Node class. The discussion includes initializing a Node and ensuring it can link to another node, setting the groundwork for building a…