javascript-algorithms
javascript-algorithms copied to clipboard
Inserting, removing, accessing, modifying, by index, on linked list
Insert(head, index, value)
Pre: head is the head node in the list
Post: the list at the new index is the value; all items in the list are shifted up one index (trivial in a linked list).
Remove(head, index)
Pre: head is the head node in the list
Post: the item at the index is returned; all items after that index are shifted down one index (trivial in a linked list).
Get(head, index)
Pre: head is the head node in the list
Post: the item at the index is returned.
Set(head, index, value)
Pre: head is the head node in the list
Post: the previous item at the index is returned; the index now holds the new value
These seem like important features to be in a list. Should we add these? (Also, I'm kinda new to contributing; should these 4 functions be separate issues, or are they related enough that they make sense as one issue?)
Hi @willow-iam, I decided to work on the Linked-Lists functions you asked for.
I created this pull request to learn more about open source for a Intro to software Engineering course I am taking. This is my first open source contribution so I hope it gets accepted!
I created functions for remove (deleteAtIndex), get (findByIndex) and set (setAtIndex). I did not create the insert function as that is already an existing function for linked-lists.
I also created test cases for all of these functions to ensure they work optimally and correctly!
can i contribute to this issue ??