The Many Ways of Reversing a Linked List
Published in
1 min readFeb 27, 2016
A linked list is a data structure that consists of a set of data elements, called nodes. Each node then has an object (integer, string, etc…) and a pointer to the next node as its attributes.
Here is a simple implementation of a linked list in C++:
Method 1: Iteration
Method 2: Recursion (with two input parameters)
Method 3: Recursion (with one input parameter)
Thanks for reading! If you find an error in this post, please feel free to comment below and I will do my best to address any issues.