× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re[2]: Based variables
  • From: "Eric N. Wilson" <doulos1@xxxxxxxx>
  • Date: Fri, 8 Dec 2000 11:00:50 -0800
  • Organization: Doulos Software & Computer Services

Hello Mark,

Friday, December 08, 2000, 9:33:11 AM, you wrote:

<Snip>

> Another technique in the RPG Programmer's guide is to create a Linked List.
> The problem with this is that it requires at least 2 pointers per record,
> and possibly 3, and creates a lot of pointer management issues.  The above
> technique requires only 1 pointer for the data, and an additional pointer
> for the Based Data Structure.

A Singly Linked List requires only 1 pointer. The pointer to the Next
record (or some magic value to mean the end of the road, usually
*NULL).

A Doubly Linked List requires 2 pointers. A pointer to the Next Record
and a pointer to the first record.

A Binary Tree requires 3 pointers. A pointer to the parent, a pointer
to the right child, and a pointer to the left child.

And if you do not want the actual list to contain the data then add a
pointer to your data in there.

Then there are all sorts of other tree and hash and dictionary
structures which I will point the interested parties to Donald Knuth's
"The Art of Computer Programming" "Fundamental Algorithms" which is
Volume one in the 3 (soon to be 4) volume set. This is my personal
favorite set of books on programming :-)

Once you have the code to manage a linked list, etc... written you can
reuse it over and over and never have to write it again.


----------------------------------
Eric N. Wilson
President
Doulos Software and Computer Services


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.