From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: creating database
Date: Sun, 08 May 2005 19:36:00 +0200
Date: 2005-05-08T19:35:50+02:00 [thread overview]
Message-ID: <87sm0xmxhb.fsf@insalien.org> (raw)
In-Reply-To: 1115570998.707181.84650@o13g2000cwo.googlegroups.com
writes:
> hi
>
> I'm trying to create a database using ada. I'm struggling to work
> out how to implement the record type and storage. The data only has
> to be stored in main memory.
>
> 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.
>
> Any advice one how to implement the database would be very much
> appreciated. As an ada novice, I'm struggling.
We do not do students' homework for them, so I'm not going to give you
"the answer" here (if you're not a student, this sentence is intended
for future readers who may be students).
Your question is not specific to Ada or any particular language. It
is a design question. If I understand well, you're trying to store a
variable (and unknown at compile time) number of "things" in memory.
There are many well-known data structures to choose from, or you could
roll your own. The simplest data structure you can try is called a
"linked list". Look it up on Google. A linked list is simple and
efficient when adding new "things", but inefficient when searching for
one particular "thing". Most industrial-strength database engines use
more sophisticated data structures such as B-trees (q.v., on Google).
HTH
--
Ludovic.
next prev parent reply other threads:[~2005-05-08 17:36 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 [this message]
2005-05-08 18:17 ` Jacob Sparre Andersen
2005-05-09 2:51 ` Matthew Heaney
2005-05-08 18:24 ` Jacob Sparre Andersen
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