Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-2008, 04:58 PM
Member
 
Join Date: Jan 2008
Posts: 12
pringle is on a distinguished road
Method Help
I have a file listing:

A customer name
An account number
A balance

each on different lines. I need to sort the file into ascending account number order.
Do I use a bubble sort for this?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-16-2008, 01:53 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 260
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
I recommend quicksort algorithm when you do it by that example..... or not so huge files...

Depends on how will you optimize it....

Its just for me, and kind regards,
sukatoa.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 02:13 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 1,180
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Sukatoa, how about the bubble sort algorithm. Since he used the account number to sort, may be it's easy.

Actually why I ask this is that I'm not familiar with the quicksort algorithm at least once. What you think of it.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Want to make your IDE the best?Vote Now
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 02:20 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 220
DonCash will become famous soon enoughDonCash will become famous soon enough
There are several sort Methods.. I'm not sure which one works best though as I haven't used them all.

For a good example of the Bubble sort, check this out:

http://www.java-forums.org/java-lang...html#post17238

If you require more help then please post an example of the file.
__________________
Did this post help you? Please me! || Don't forget to: Mark your Thread as Solved
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 02:23 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 1,180
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by DonCash View Post
There are several sort Methods.. I'm not sure which one works best though as I haven't used them all.
Yes it's true. In my experience I used bubble sort in great way, so I know how to use it. Even though I can't do all the things in best way only using bubble sort algorithm. So better to deal with users comments on different sorting algorithms.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Want to make your IDE the best?Vote Now
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
method not abstract, does not override actionperformed method. Theman New To Java 1 05-08-2007 07:13 AM


All times are GMT +3. The time now is 09:37 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org