Linked Lists - Sorted Intersect
Description:
Linked Lists - Sorted Intersect
Write a SortedIntersect() function which creates and returns a list representing the intersection of two lists that are sorted in increasing order. Ideally, each list should only be traversed once. The resulting list should not contain duplicates.
var first = 1 -> 2 -> 2 -> 3 -> 3 -> 6 -> null
var second = 1 -> 3 -> 4 -> 5 -> -> 6 -> null
sortedIntersect(first, second) === 1 -> 3 -> 6 -> null
Related Kata in order of expected completion (increasing difficulty):
Linked Lists - Push & BuildOneTwoThree
Linked Lists - Length & Count
Linked Lists - Get Nth Node
Linked Lists - Insert Nth Node
Linked Lists - Sorted Insert
Linked Lists - Insert Sort
Linked Lists - Append
Linked Lists - Remove Duplicates
Linked Lists - Move Node
Linked Lists - Move Node In-place
Linked Lists - Alternating Split
Linked Lists - Front Back Split
Linked Lists - Shuffle Merge
Linked Lists - Sorted Merge
Linked Lists - Merge Sort
Linked Lists - Sorted Intersect
Linked Lists - Iterative Reverse
Linked Lists - Recursive Reverse
Inspired by Stanford Professor Nick Parlante's excellent Linked List teachings.
Similar Kata:
Stats:
Created | Sep 2, 2015 |
Published | Sep 2, 2015 |
Warriors Trained | 1119 |
Total Skips | 150 |
Total Code Submissions | 1699 |
Total Times Completed | 540 |
JavaScript Completions | 218 |
Python Completions | 256 |
Swift Completions | 85 |
Total Stars | 25 |
% of votes with a positive feedback rating | 90% of 147 |
Total "Very Satisfied" Votes | 127 |
Total "Somewhat Satisfied" Votes | 12 |
Total "Not Satisfied" Votes | 8 |