Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!hplabs!hp-pcd!hpsgpa!daver From: daver@hpsgpa.UUCP Newsgroups: comp.sys.hp Subject: Re: HP Basic linked lists? Message-ID: <2790002@hpsgpa.HP.COM> Date: Sun, 22-Feb-87 20:34:06 EST Article-I.D.: hpsgpa.2790002 Posted: Sun Feb 22 20:34:06 1987 Date-Received: Thu, 26-Feb-87 22:48:04 EST References: <1084@phred.UUCP> Organization: HP Singapore IC Design Ctr Lines: 18 Back in the days when FORTRAN was the only alternative to COBOL and assembly language we did linked lists by using three arrays, one for each pointer and one for the data. In (minimal) Basic you could define three arrays, D for the data, N for 'next_pointer' and P for 'previous_pointer' and step through and array forward by: J=N(J) backward by: J=P(J) and add an element after element j by: P(T)=J N(T)=N(J) D(T)= P(N(T))=T N(J)=T T=T+1 where T points to the first unused element in the arrays. It would also be simple to implement a second linked list of free elements in the array to provide efficient use of memory when elements are removed.