C# 中的链表
LinkedList 属于 C# 中可用的 System.Collections.Generic 命名空间。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