The Artima Developer Community
Sponsored Link

Java Answers Forum
Requesting help with a number sort/algorithm

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mark Schuh

Posts: 8
Nickname: shoe2
Registered: Feb, 2003

Requesting help with a number sort/algorithm Posted: Feb 28, 2003 3:22 PM
Reply to this message Reply
Advertisement
Greetings,

I am very new to Java.

Below is a program that will copy the data (numbers) of one file to another new file. It requests the name of each file. It works fine. I am now trying to copy over to the new file--only one of each number--in other words I want to eliminate repeated numbers. If my source file consists of these numbers:
1, 5, 7, 7, 8, 9, 9, 9, 22, 34 -9sentinel I only want to copy over the 1, 5, 7, 8, 9, 22, and 34. (The -9 is taken care of)

Can anyone lead me in the right direction on how I can solve this problem to get rid of repeated numbers?

One other question: Are my Exceptions satisfactory or is there a better way to incorporate them?

Any help would be greatly appreciated.

Best Wishes

Mark Schuh

Topic: Random Number Problem Previous Topic   Next Topic Topic: Math.random()

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use