Results 1 to 3 of 3
- 02-16-2011, 09:55 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 6
- Rep Power
- 0
can someone suggest me how to sort data..?
Hi everyone,
I have this time-output data like this in txt data type..
and i want to sort it out by every row in the next time data is the sum of all the previous time data,like this..XML Code:time,output 0.6,20.0 1.0,40.0 0.8,20.0
i tried to use TreeMap by recklessly adding another column before the time column and sorting it with A to Z,hoping it will update with the natural order ABC but it doesnt work well. Can anyone suggest me something because i kinda use all of my ideas right now..XML Code:0.6,20.0 1.6,40.0 2.4,20.0
- 02-16-2011, 10:20 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
You are not doing any sorting, whatsoever. Use a simple arraylist and perform the "+" before adding to the list (either by "maintaining" the previous sum, or by first retreiving the last item in the list).
- 02-17-2011, 01:50 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Write a program that sorts data from a text file and sort them in a file
By danmgz45 in forum New To JavaReplies: 6Last Post: 12-01-2010, 05:31 AM -
Using Merge Sort to sort an ArrayList of Strings
By coldfire in forum New To JavaReplies: 3Last Post: 03-13-2009, 01:03 AM -
Please suggest me the correct approach!
By rjuyal in forum Advanced JavaReplies: 6Last Post: 05-05-2008, 02:54 PM -
How to sort a list using Bubble sort algorithm
By Java Tip in forum AlgorithmsReplies: 3Last Post: 04-29-2008, 08:04 PM -
Please suggest a database ?
By Vinuraj in forum CLDC and MIDPReplies: 1Last Post: 01-14-2008, 08:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks