Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

reverse a linked list C#

//ll is the LinkedList
//using System.Linq
foreach(string item in ll.ToArray()){ll.AddFirst(item);ll.RemoveLast();}

//without using System.Linq

List<string> lll = new List<string>(ll);
for(int i=0;i<ll.Count;i++){ll.AddFirst(lll[i]);ll.RemoveLast();}
Comment

reversing linkedlist C#

Node p = root, n = null;
while (p != null) {
    Node tmp = p.next;
    p.next = n;
    n = p;
    p = tmp;
}
root = n;
Comment

PREVIOUS NEXT
Code Example
Csharp :: export xml 
Csharp :: Unity PlayOneShoot Audio 
Csharp :: c# linq foreach example 
Csharp :: dotween do rotate on one axis 
Csharp :: auto refresh gridview c# 
Csharp :: how to get the askii code of a char in c# 
Csharp :: c# linq where value is max and one item 
Csharp :: user input in c# 
Csharp :: serenity.is required field 
Csharp :: get current culture in controller asp.net core 6 
Csharp :: stateteach.net 
Csharp :: .netstandard distinctby iqueryable 
Csharp :: enum extends dictionary c# 
Csharp :: ilist validation wpf mvvm 
Csharp :: assign a list to another in c# without a loop 
Csharp :: unity make particles stay still 
Csharp :: C# free text search 
Csharp :: c sharp while statement 
Csharp :: wcf service dependency injection 
Csharp :: windows 10 see how long a program has been running 
Csharp :: c# int cast error 
Csharp :: vb.net tostring numeric format string 
Csharp :: draw table in console c# 
Csharp :: minimum value int C# 
Csharp :: c# write line variable 
Csharp :: c# filesystemwatcher 
Csharp :: Unity inverse kinematics nothing is happening 
Csharp :: how to do Employing defensive code in the UI to ensure that the current frame is the most top level window in c# 
Html :: html input integer and positive 
Html :: regex href html pattern 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =