Zip two linked lists.
data-structures-and-algorithms
public repository.Branch Name: linked-list-zip
Challenge Type: Code Challenge / Algorithm
zipLists(list1, list2)
Arg list1 |
Arg list2 |
Output |
---|---|---|
{1} -> {3} -> {2} -> null |
{5} -> {9} -> {4} -> null |
{1} -> {5} -> {3} -> {9} -> {2} -> {4} -> null |
{1} -> {3} -> null |
{5} -> {9} -> {4} -> null |
{1} -> {5} -> {3} -> {9} -> {4} -> null |
{1} -> {3} -> {2} -> null |
{5} -> {9} -> null |
{1} -> {5} -> {3} -> {9} -> {2} -> null |
On this, and all future challenges, write tests for any cases that help you ensure your code is working as expected. Think through different edge cases to determine what tests will ensure your code is covered.
Once you’ve achieved a working solution, implement another function that merges two sorted linked lists into a single sorted linked list.
Ensure your complete solution follows the standard requirements.