Solution Review: Reverse a Linked List
This review provides a detailed analysis on solving the "Reverse a Linked List" challenge
We'll cover the following...
Solution #
Press + to interact
main.cs
LinkedList.cs
using System;namespace chapter_3{class Challenge_5{static void Main(string[] args){LinkedList list = new LinkedList(); //creating listfor (int j = 1; j <= 7; j++){list.InsertAtHead(j); //insertng data in listlist.PrintList();}string reversed = list.Reverse(); // calling reverse function of listConsole.WriteLine("List after reverse function : " + reversed);return;}}}
The brain of this solution lies in the loop, which iterates through the ...