CKTIS / C#
System.Collections.Generic.LinkedList: praktická reference
System.Collections.Generic.LinkedList: praktická reference: LinkedList<T> je obousměrně propojený seznam s konstantním vložením či odstraněním známého uzlu.
Verze: .NET API; verified on .NET 10.0.14
Syntaxe
System.Collections.Generic.LinkedList /* select a documented member or constructor */LinkedList je obousměrně propojený seznam s konstantním vložením či odstraněním známého uzlu.
Použijte jej, když často přesouváte známé uzly a nepotřebujete náhodný přístup podle indexu.
Vyhledání hodnoty je lineární a každý LinkedListNode může současně patřit jen do jednoho seznamu.
First a Last jsou u prázdného seznamu null a odstraněnému uzlu se vymaže vlastnost List.
Úplný program skutečně používá System.Collections.Generic.LinkedList; přesně očekávaný stdout je 2,3.
Příklady
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
var list = new LinkedList<int>();
list.AddFirst(2);
list.AddLast(3);
Console.WriteLine($"{list.First!.Value},{list.Last!.Value}");
Výsledek
2,3
Úplný program skutečně používá `System.Collections.Generic.LinkedList`; přesně očekávaný stdout je `2,3`.