[fpc-devel] TList or TFPList - a Linked list ?
Michael Van Canneyt
michael at freepascal.org
Wed Dec 14 22:12:40 CET 2005
On Wed, 14 Dec 2005, Micha Nelissen wrote:
> On Wed, 14 Dec 2005 21:44:50 +0100 (CET)
> Daniël Mantione <daniel.mantione at freepascal.org> wrote:
> > Op Wed, 14 Dec 2005, schreef Micha Nelissen:
> > Sorry to disappoint, but this doesn't look a very good idea to me; it
> > would kill code that for example tries to sort a list. There will be also
> > a lot of code that iterates using index.
> Did you read the paragraph, "to solve (2) ..." ? Sorting is also quite a
> "local" operation, no ? No truly random-access is needed.
QuickSort is not so local, definitely not in the beginning.
> > Programmers need both list like datastructures and array like data
> > structures. It is part of converting mathematical abstraction principles
> Array like datastructures are provided by dynamic arrays, I'd say ?
> > like a sequence where every operation is O(1), to actual datastructures
> > that are to be used inside a compiler. Programmers need both of them, not
> > one or the other.
> Yes, currently there is no linked list at all, is there ?
> These issues are precisely the reason I'm writing to the list and gathering
> ideas first.
Excellent, maybe now we'll finally have a decent TLinkedList :)
An excellent location is the contnrs unit.
It already contains the TStack and TQueue.
TLinkedList perfectly fits in this list.
More information about the fpc-devel