sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 180 forks source link

TreeList<T>? #97

Open Shadowblitz16 opened 3 years ago

Shadowblitz16 commented 3 years ago

I just installed C5 2.5.3 and there doesn't seem to be a TreeList type.

I need a ordered, reorderable, generic tree collection that allows duplicates

sestoft commented 3 years ago

On 13 May 2021, at 20.55, Shadowblitz16 @.**@.>> wrote:

I just installed C5 2.5.3 and there doesn't seem to be a TreeList type.

I need a ordered, generic tree collection that allows duplicates

What is the usage scenario?

Would a MultiDictionary be sufficient, see the C5 handbook section 11.12, eg here: https://www.itu.dk/research/c5/latest/ITU-TR-2006-76.pdf

Peter

Shadowblitz16 commented 3 years ago

I wanted to use it for a entity component system. I need the items to be reorderable and allow multiple instances of the same object

sestoft commented 3 years ago

On 17 May 2021, at 23.50, Shadowblitz16 @.**@.>> wrote:

I wanted to use it for a entity component system.

I need the items to be reorderable and allow multiple instances of the same object

So the items are not ordered by a comparer?

Peter

Shadowblitz16 commented 3 years ago

no by a index

sestoft commented 3 years ago

Would a HashedLinkedList where the hashing is on that index serve this purpose? Constant-time access to items by index, reorderable, duplicate objects (but not indices) allowed, sequential traversal, insertion etc

On 21 May 2021, at 01.23, Shadowblitz16 @.**@.>> wrote:

no by a index

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/sestoft/C5/issues/97#issuecomment-845546129, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFSQEH5CQ3CX2UQDPSJUSTTOWKVRANCNFSM443B735Q.

Shadowblitz16 commented 3 years ago

Is a HashedLinkedList a tree collection? a simple list won't do