Well, I don't really understand what you mean by "first database can have many records or each record in the database points a linked list of their sub"; however, I think the answer is pretty simple.
Assuming each list is displaying a different type of data, store that data in a separate database, with each 'child' database containing a key field that links to its parent. Display the parent data in the first list as usual; when a record is selected, find and display the child records from the second database (if that database is sorted on your 'key' value, a binary search will find these records very quickly). Same deal for the third table. This approach has many advantages: it's simple, it's flexible, it supports random access to all your data, and it allows you to read records directly from storage rather than having to load them into a linked list somewhere. Does this make sense? "SU DUY TRINH" <[EMAIL PROTECTED]> wrote in message news:72669@palm-dev-forum... > > Hey, > What do you think about the hierachy model for > some palm apps (on palm > hand-held)?For examples:I have a database with many > records,all the records > are showed in list and then I click on a item of the > list,It shows for me > about some "subrecords" of the clicked record and then > each "subrecords" > has many "subrecords" and then so on.So I must use a > data structure in tree > model like this: > > struct Record > { > char contents[NAME_LENGTH+1]; > Boolean haveSub;//Have sun or not > Record *refRec;//refer to list of subrecords of a > record > }; > typedef Record *RecordPtr;?????? > My problems is the following:How do the subrecords > of a record save? > For examples:I have a database with five records,each > record has struct as > above,each record has a list of some subrecords(linked > list).How do the > subrecords of the record save?In other database,if we > use the case,I think > that:It isn't good because first database can have > many records or each > record in the database points a linked list of their > sub.How do data > structure organize for the case? > Thanks in advance, > Trinh. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
