通用链接列表类,无需使用System.Collections库C# [英] Generic linked list class without using System.Collections libraries C#

查看:86
本文介绍了通用链接列表类,无需使用System.Collections库C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以在不使用C#中使用System.Collections库的情况下帮助我开发通用链表类吗?
代码段会很棒.

谢谢
Raj

Can some one help me in developing an generic linked list class without using System.Collections libraries in C# .

Code snippet would be great.

Thanks
Raj

推荐答案

链接列表是控件的集合,这些控件维护对列表中下一项和上一项的引用或指针.循环链接列表与列表相同,只是列表中的第一项包含对最后一项的引用,反之亦然.
为了创建链接列表而不使用Collection库,您只需要创建一个包含对象数组的类.每个对象都应引用列表中的下一个和上一个项目.包含数组的父类需要通过诸如Add,Remove,Insert等方法来管理这些引用.
A linked list is a collection of controls which maintain a reference or pointer to the next and previous items in the list. A circular linked list is the same with the exception that the first item in the list contains a reference to the last and vice versa.
In order to create a linked list without using the Collection libraries you just need to create a class that contains an array of your objects. Each object should hold a reference to the next and previous items in the list. Your parent class that contains the array needs to manage these references via methods like Add, Remove, Insert, etc...


希望此链接有所帮助.
C#中具有基本和高级自定义操作的通用SinglyLinkedList [ ^ ]
Hope this link helps.
Generic SinglyLinkedList in C# with Basic and Advanced Custom Operations[^]


这篇关于通用链接列表类,无需使用System.Collections库C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆