[futurebasic] Linked Lists

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1998 : Group Archive : Group : All Groups

From: Vic Maslen Advanced Materials <maslen@...>
Date: Sun, 27 Sep 1998 12:43:49 +1000 (EST)
"Tedd's Linked List", the source code for which is posted
on the FBwebring, is a very well presented piece of code.
Using this as a starting point, I would like to ask a couple
of questions about Linked Lists, which might be useful in my
present work.
Question 1:  In the quoted example, record data seems to be stored
progressively in a block of memory as follows:
address(2)info(1)address(3)info(2)....address(n+1)info(n). 
Here info(i) indicates the variable data in the ith record and
address(i+1) is the address of record (i+1), which stored as an element
of record i. If the memory block required for the list has to be 
relocated when n grows, then I would expect the early addresses
to become out of date, judging from the order in which this
information is stored in the example.  But, since Tedd's algorithm
works, my fear is evidently unfounded. Could someone please explain
how the address information keeps up to date with memory relocation?
Question 2:  While "Tedd's Linked List" demonstrates how to construct 
a Linked List, I would appreciate a simple example of a
situation where a Linked List is of particular value.  Alternatively,
could someone kindly refer me to a book refenece that discusses the 
elements of Linked Lists?
Help in understanding the Linked List concept would be appreciated
Vic Maslen