I have a question about LinkedList<>.
There are properties of this list First and Last.
Will that properties correct if I will set Last.AddNext(First)?
I need to have a list where Last>Next = First, but identify clearly the First and Last elements.
I have a cycle process.NextStep, NextStep, but need to be able to identify each Step (process[i] – the i-th Step)
.NET 2
LinkedList<T>doesn’t support circular lists. From the docs:There’s no such method as
LinkedListNode<T>.AddNext(), but I’d expect any attempt to cause a cycle to fail with an exception.You could always build an iterator based on a
LinkedList<T>though…(Note that this will fail if the list is empty…)
Each tuple in the return sequence will be
(value, isFirst, isLast)if you see what I mean.