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 :: check if two timespans intersect c# 
Csharp :: c# to pascal case 
Csharp :: unity get audio clip length 
Csharp :: C# How to make a field read-only outside of class 
Csharp :: C# Convert 1 range to another 
Csharp :: c# list string where 
Csharp :: Why Duplicate "..TargetFrameworkAttribute" c# assemblies created 
Csharp :: c# instance class with ilogger 
Csharp :: c# read excel file into datatable 
Csharp :: int array to frequency dictionary c# 
Csharp :: asp c# page scroll position change after postback 
Csharp :: how to hide the title bar of window in monogame 
Csharp :: unity rigidbody freeze rotation y z 
Csharp :: c# get every point in a line in matrix 
Csharp :: concatanate two lists in c# 
Csharp :: C# show text in another form 
Csharp :: unity how to find the largest value out of 2 numbers 
Csharp :: install nuget package for S3 
Csharp :: c# short to int 
Csharp :: how to access resources in c# 
Csharp :: c# get executing file name 
Csharp :: C# how to know if number is even or odd 
Csharp :: c# byte + byte is int 
Csharp :: check if element in hashset c# 
Csharp :: array sum c# 
Csharp :: summernote dropdown plugin 
Csharp :: fill dictionary c# 
Csharp :: how to set a color of text in unity 2020 script 
Csharp :: reference to gameobject in different scene unity 
Csharp :: if else c# 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =