[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

548.0. "Non unique keys in a file ?" by DDMAIL::ANDREWS (Just living a life of illusion) Wed Sep 09 1987 00:30

Hello,

I have a question.  I am writting a(nother) calendar access program for
my Amiga (in BASIC) need a little help on how to store the dates as the
keys in a file. I realize that the easiest way would be to sequencially
store them then search, but this is going to be slow once the file gets
large.

Those of you who have solved this problem, how did you do it?  If you
have any sort of idea (psedocode, source, even a rudimentry flowchart)
could you help ?

				Thanks,

					Rob
T.RTitleUserPersonal
Name
DateLines
548.1PSW::WINALSKIPaul S. WinalskiSun Sep 13 1987 20:059
What you want is an indexed sequential file.  If BASIC on the Amiga doesn't
have built-in ISAM support, then you will have to implement it yourself.
Your best bet is to store the index structure as a B-tree.  Take a look in
Knuth's THE ART OF COMPUTER PROGRAMMING, Volume 3:  Sorting and Searching.
The algorithms for constructing and searching B-trees are given there.  You
can also find them in other computer science textbooks dealing with data
structures and file representations.

--PSW