Created as part of The Odin Project curriculum.
View on Github
This is the linked lists project, which serves to introduce data structures by creating linked lists.
Method | Description |
---|---|
#append(value) | Adds a new node containing value to the end of the list |
#prepend(value) | Adds a new node containing value to the beginning of the list |
#size | Returns the total number of nodes in the list |
#head | Returns the first node in the list |
#tail | Returns the last node in the list |
#at(index) | Returns the node at the given index |
#pop | Removes the last element from the list |
#contains?(value) | Returns true if the passed in value is in the list and otherwise returns false. |
#find(value) | Returns the index of the node containing value, or nil if not found. |
#to_s | Represent your LinkedList objects as strings, so you can print them out and preview them in the console. |
#insert_at(value, index) | Inserts a new node with the provided value at the given index. |
#remove_at(index) | Removes the node at the given index. |
This really helped me understand and see the beauty in recursive methods. It also helped me deepen my understanding of data structures.