[comp.lang.pascal] Choosing a data structure.....

cmt@tybalt.caltech.edu (Rich Siegel c/o Etoyoc) (11/11/86)

[			EAT ME RAW!!! Line Eater!!!			]

[	I am posting this for a friend who is unable to post to the	]
[	evolving net at this time.  All replies should be routed to	]
[	him or the net.  He still can read.  Enjoy...			]

I am working on a plotting program for the Macintosh, and I've chosen Pascal
as my language, because I don't know C, and while the implementation of
Fortran on the Macintosh offers superior floating-point speed over any other
Macintosh language, Fortran's too clumsy for me to work with in this case.

I have chosen to use a linked list to hold my data, because it offers
flexibility to expand to hold a nearly unlimited amount of data. What bothers
me is that accessing the data in this list is kind of slow; it takes twice as
long to load the data into the linked list as it did to load the data into an
array.

Is there any way that I can combine the flexibility of a linked list with the
speed of an array? I've had some ideas; for example, a pointer on the
Macintosh can be made to point to a block of arbitrary size, and this size
can be changed. Perhaps if I load the values, dynamically change the block
size, and whenever I want to get an indexed value, calculate the address? I
know the size of a number (10 bytes), so maybe that wouldn't be too
difficult....

Any suggestions?

		--Rich

rs4u@andrew.cmu.edu