General List for Delphi 2009

I looked in Generics.Collections and noticed that there is no linked list. Of course, they are easy to make, but I thought it was strange that they were not (or I just skipped this). Are lists obsolete compared to new modern data structures, or is there a need for a common, common linked list? Does anyone know about this?

+4
source share
4 answers

Do you know DeHL ?

I think the TLinkedList<T> from DeHL.Collections.LinkedList.pas is exactly what you are looking for.

+11
source

In the old days, almost any piece of serious software contained linked lists or trees.

I have not used linked lists a lot, but trees are another story.

With the introduction of dynamic arrays, there is no need for linked lists. But I can imagine that you want to use it if your data structure changes frequently (add + delete).

You can easily create a common linked list yourself using the container class and entries for the elements.

+2
source

I do not know any common linked list in the existing RTF Delphi.

However, they are still very useful as a data structure. Especially if you include options in a linked list, such as b-tree or binary tree. Unlike a regular list, a linked list can be expanded, modified, or modified without moving data in memory. They are very simple in version and work well in purely functional code that does not allow mutation of existing data. Thus, it is still a very useful data structure.
+1
source

What's the use of tStringList?

(immersion in water)

In fact, any generic tList works fine as a linked list and provides most of the necessary functions. An ancient technique was passed from our ancestors to storing a pointer to memory in each record, and the transition to it was easily replaced by dynamic arrays and did things ... more general.

0
source

Source: https://habr.com/ru/post/1286121/


All Articles