data-structures-and-algorithms

401 data structures and algorithms code challenges


Project maintained by alsosteve Hosted on GitHub Pages — Theme by mattgraham

Data Structures and Algorithms

Language: Python

Linked Lists Zip

Feature Tasks

Zip two linked lists.

Write the following method for the Linked List class:

Whiteboard Process

challenge08

Examples

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

Stretch Goal

Implement another function that merges two sorted linked lists into a single sorted linked list.

Approach & Efficiency