Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

which data structure to use

Thread view: 
Petterson Mikael - 13 Jun 2005 11:41 GMT
Hi,

I have data that I need to store in a data structure:
key      value
===    =====
name     object

What is a good data stucture to use if I need to sort the keys ( and the
accompanied objects)?

//mikael
Stefan Schulz - 13 Jun 2005 11:56 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> What is a good data stucture to use if I need to sort the keys ( and the
> accompanied objects)?

Seems like java.util.SortedMap is just what you need. Take a look at the
API docs. ;) There, you'll also find a handy ready-made implementation

Signature

In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
          --- Rear Admiral Grace Murray Hopper

Thomas G. Marshall - 13 Jun 2005 22:58 GMT
Stefan Schulz coughed up:

...[rip]...

(quoted signature:)
> In pioneer days they used oxen for heavy pulling, and when one ox
> couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
> be trying for bigger computers, but for more systems of computers.
>            --- Rear Admiral Grace Murray Hopper

Bah.  {blowing raspberries with much spit}

They always tried to grow the most powerful oxen possible.  That quickly hit
an upper limit, and they were left with no choice than to team them
together.

In the case of computers, people also try to make the most powerful systems
possible.  And they still get teamed together when it's cost effective to do
so.

Signature

Puzzle: You are given a deck of cards all face down
except for 10 cards mixed in which are face up.
If you are in a pitch black room, how do you divide
the deck into two piles (may be uneven) that each
contain the same number of face-up cards?
Answer (rot13): Sebz naljurer va gur qrpx, qrny bhg
gra pneqf naq syvc gurz bire.

Andrew Thompson - 14 Jun 2005 11:23 GMT
> Stefan Schulz coughed up:
>
[quoted text clipped - 15 lines]
> possible.  And they still get teamed together when it's cost effective to do
> so.

R.A. Grace Murray Hopper died in 1992 at the age of 85.

Presuming she said that at 'retirement age' of 65, that places
the statement at 1972 (but quite probably before that).  1972
was 33 years ago.

If we had simply tied more computers together as from that point, we
would need a ..lot more computers to service the needs of our current
day computing needs.

Taking Moore's law of a doubling in processor speed every 18 months,
would lead to approximately 2^(33/1.5) ..or 2^22 or 4,194,304 computers
for every current day machine.

Not that I hav anything against running thousands of processors
in parallel (I am over this entire 'You can have 1 ..or 2
processors!' deal) but R.A. G.M.H.'s suggestion seems rather impractical.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Aki Laukkanen - 14 Jun 2005 11:39 GMT
>>Stefan Schulz coughed up:
>>
[quoted text clipped - 34 lines]
> in parallel (I am over this entire 'You can have 1 ..or 2
> processors!' deal) but R.A. G.M.H.'s suggestion seems rather impractical.

Once you put it that way, it *does* really sound rather ridiculous.
(Imagine having roughly four million computers of the 1970's era on
*your* desk ;-)

However, it still doesn't prevent parallel processing from being an
effective solution in some cases - SETI@home and similiar "donate you
computer's spare processor time"-schemes for example.

Signature

-Aki "Sus" Laukkanen

Eric Sosman - 14 Jun 2005 15:32 GMT
> R.A. Grace Murray Hopper died in 1992 at the age of 85.
>
[quoted text clipped - 9 lines]
> would lead to approximately 2^(33/1.5) ..or 2^22 or 4,194,304 computers
> for every current day machine.

   Taking today's processor speed as 3 GHz, the same
calculation says the 1972 machine ran at about 715 Hz.

   (Geez, it sure seemed faster to me -- but I was young
and impressionable back then, and probably *wanted* to
believe the instruction timing numbers were in microseconds
rather than their milliseconds.  Hmmm: Anybody know how that
715 Hz machine kept pace with the card reader? ;-)

Signature

Eric.Sosman@sun.com

Matt Humphrey - 14 Jun 2005 16:02 GMT
> > Stefan Schulz coughed up:
> >
[quoted text clipped - 33 lines]
> in parallel (I am over this entire 'You can have 1 ..or 2
> processors!' deal) but R.A. G.M.H.'s suggestion seems rather impractical.

Great analysis, Andrew.  I couldn't find a date of attribution for the
quotation, but I did find that her official Navy retirement was in 1986 and
she was still working as a consultant for DEC up until her death. (I'll skip
jumping to a cynical conclusion there.)
http://en.wikipedia.org/wiki/Grace_Hopper

It's also true that parallel computing is much more effective for numerical
analysis and hardware systems than for ordinary desktop applications, so we
are making use of parallel processors today, just not in terms of general
computing power.

Cheers,
Matt Humphrey   matth@ivizNOSPAM.com  http://www.iviz.com/
Andrew Thompson - 14 Jun 2005 16:35 GMT
> "Andrew Thompson" <SeeMySites@www.invalid> wrote in message

..
>> R.A. Grace Murray Hopper died in 1992 at the age of 85.
>>
>> Presuming she said that at 'retirement age' of 65,
...
> Great analysis, Andrew.  

Except for the guess of the retirement age..

>..I couldn't find a date of attribution for the
> quotation, but I did find that her official Navy retirement was in 1986 ..

She retired from the services at 80(?!) (and that was involuntary).

<sheepish grin>
And there I was, about to set her retirement age at 60!
</sheepish grin>

> It's also true that parallel computing is much more effective for numerical
> analysis and hardware systems than for ordinary desktop applications, so we
> are making use of parallel processors today, just not in terms of general
> computing power.

It is a pity. I feel we are misapplying single and dual processor
based machines where massive-parallelism would be a distinct advantage,
especially in analysing 'real world' data.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.