Skip to content

munificent/linkedlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apparently, a common programming interview question these days is to write a
function that reverses a linked list. Sometimes they explicitly request a
recursive or iterative solution. Like most bare data structure programming,
getting this right is surprisingly finicky (which is why most of us these days
use nice libraries that provide higher-level abstractions for this).

Just to make sure I'm keeping my tools sharp, I went ahead and implemented this
in all four permutations of:

- Recursive or iterative
- In-place or creating a new list

Unsurprisingly to any functional programmer, the recursive immutable list one is
the most terse.

About

Reversing a linked list

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages