C# 中的链表
System.Collections.Generic 命名空间在 C# 中用于 LinkedList。LinkedList<T> 类允许以较快的速度在列表中插入和删除元素。
C# LinkedList<T> 类使用链表的概念。它使我们能够快速插入和删除元素。它可以具有重复的元素。可以在 System.Collections.Generic 命名空间中找到它。
这里有一个示例 -
示例
using System;
using System.Collections.Generic;
class Demo {
static void Main() {
LinkedList < string > l = new LinkedList < string > ();
l.AddLast("one");
l.AddLast("two");
l.AddLast("three");
foreach(var ele in l) {
Console.WriteLine(ele);
}
}
}输出
one two three
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP