Re: Choice of data structures
From: Jon Boone (ipmonger_at_comcast.net)
Date: 09/27/04
- Next message: Julian Stecklina: "Re: conditions vs. call/cc"
- Previous message: Russell McManus: "Re: conditions vs. call/cc"
- In reply to: Mark McConnell: "Re: Choice of data structures"
- Next in thread: Will Hartung: "Re: Choice of data structures"
- Reply: Will Hartung: "Re: Choice of data structures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Sep 2004 08:44:03 -0400
On 2004-09-27 07:31, in article
d3aed052.0409270331.3dba1ade@posting.google.com, "Mark McConnell"
<mmcconnell17704@yahoo.com> wrote:
> I'm wondering if you need the hashing. If you need to do some
> random-access operation, then sure, hashing is necessary. But
> random-access operations are not mentioned directly in 1 and 2.
>
> You could store the time in each piece of data, then use binary search
> to find ranges of data defined by time. Put the data into the generic
> sequences (Java's ArrayList, Lisp's adjustable-array) in the order it
> comes in, i.e., sorted by time. To find all the data from Tuesday
> 9/21 to Thursday 9/23, use a binary search to find 9/21, then another
> binary search (starting from the 9/21 point) to find 9/23.
I was planning on using hashes to make out-of-order data insertion easier.
Since things would be keyed by the data-collection-date, I could just insert
the data according to the hash (not really caring where it ended up). When
I wanted to pull things out in sequence, I'd use the sorted keys to pull the
data in sequence.
I've never used adjustable-arrays. I'll spend some time looking at them
and see if I can figure out how to work out the out-of-order data insertion.
--jon
- Next message: Julian Stecklina: "Re: conditions vs. call/cc"
- Previous message: Russell McManus: "Re: conditions vs. call/cc"
- In reply to: Mark McConnell: "Re: Choice of data structures"
- Next in thread: Will Hartung: "Re: Choice of data structures"
- Reply: Will Hartung: "Re: Choice of data structures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|