DataStructures-and-Algorithms

Code Challenge

Zip two linked lists.

Specifications

Challenge Setup & Execution

Branch Name: linked-list-zip

Challenge Type: Code Challenge / Algorithm

Feature Tasks

Example

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

Unit Tests

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.

Stretch Goal

Once you’ve achieved a working solution, implement another function that merges two sorted linked lists into a single sorted linked list.

Requirements

Ensure your complete solution follows the standard requirements.

  1. Write unit tests
  2. Follow the template for a well-formatted README
  3. Submit the assignment following these instructions