{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
Reverse a singly linked list.
\n", "\n", "Example:
\n", "\n", "Input: 1->2->3->4->5->NULL\n",
"Output: 5->4->3->2->1->NULL\n",
"\n",
"\n",
"\n", "Source \n", "
A linked list can be reversed either iteratively or recursively. Could you implement both?
\n", "\n", "