comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: creating database
Date: 08 May 2005 20:24:56 +0200
Date: 2005-05-08T20:24:56+02:00	[thread overview]
Message-ID: <m2is1to9s7.fsf@hugin.crs4.it> (raw)
In-Reply-To: 1115570998.707181.84650@o13g2000cwo.googlegroups.com

caellumx@yahoo.com writes:

> I was thinking of creating the ADT as a record with various fields,
> and then an array with each element containing a record. However, I
> don't know how many records there'll be so it seems inefficient to
> declare an array of a particular size.

Sensible thinking.

> Any advice one how to implement the database would be very much
> appreciated. As an ada novice, I'm struggling.

As you have already been told, this is not really an Ada specific
question.

Instead of allocating a fixed size array - which on unix systems isn't
quite as bad an idea as it sounds - you can allocate and reallocate
chunks of varying or fixed size (down to a single record element) with
pointers pointing to various other chunks.  Exactly how you do it
depends on your problem; the frequency of insertions, the frequency of
deletions, the frequency of searches and knowledge about the searches
which you can use to prearrange the elements for faster searching.

If you tell us what your problem is (and preferably also that it isn't
a homework problem), it is easier to give you specific advice.  And
even if it is a homework problem, there's probably somebody who can
point you to a good textbook or ask some leading questions.

Greetings,

Jacob
-- 
"War does not determine who is right - only who is left."
                                         -- Bertrand Russell




  parent reply	other threads:[~2005-05-08 18:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-08 17:02 creating database caellumx
2005-05-08 17:36 ` Ludovic Brenta
2005-05-08 18:17   ` Jacob Sparre Andersen
2005-05-09  2:51     ` Matthew Heaney
2005-05-08 18:24 ` Jacob Sparre Andersen [this message]
2005-05-09  5:47   ` tmoran
2005-05-09 12:33     ` Robert A Duff
2005-05-09  3:00 ` Matthew Heaney
2005-05-11 16:57   ` brian.b.mcguinness
2005-05-11 21:16     ` Georg Bauhaus
2005-05-12  0:37     ` Randy Brukardt
2005-05-12  2:41     ` Matthew Heaney
2005-05-11 10:43 ` news.snafu.de
2005-05-12  2:50   ` Matthew Heaney
2005-05-12  7:31     ` Michael Erdmann
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox