Linked Lists - Iterative Reverse
Description:
Linked Lists - Iterative Reverse
Write an iterative Reverse() function that reverses a linked list. Ideally, Reverse() should only need to make one pass of the list.
var list = 2 -> 1 -> 3 -> 6 -> 5 -> null
reverse(list)
list === 5 -> 6 -> 3 -> 1 -> 2 -> null
The push() and buildOneTwoThree() functions need not be redefined.
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 | 1804 |
Total Skips | 149 |
Total Code Submissions | 2988 |
Total Times Completed | 584 |
JavaScript Completions | 260 |
Python Completions | 240 |
Swift Completions | 105 |
Total Stars | 41 |
% of votes with a positive feedback rating | 74% of 174 |
Total "Very Satisfied" Votes | 115 |
Total "Somewhat Satisfied" Votes | 28 |
Total "Not Satisfied" Votes | 31 |
Total Rank Assessments | 19 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |