6 kyu

Linked Lists - Iterative Reverse

260 of 584JDeBolt

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.

Linked Lists
Data Structures
Algorithms

Stats:

CreatedSep 2, 2015
PublishedSep 2, 2015
Warriors Trained1804
Total Skips149
Total Code Submissions2988
Total Times Completed584
JavaScript Completions260
Python Completions240
Swift Completions105
Total Stars41
% of votes with a positive feedback rating74% of 174
Total "Very Satisfied" Votes115
Total "Somewhat Satisfied" Votes28
Total "Not Satisfied" Votes31
Total Rank Assessments19
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • JDeBolt Avatar
  • JohanWiltink Avatar
  • Bubbler Avatar
  • user9644768 Avatar
Ad