Need help sorting array

#NumberFormat(variables.queue_copy[key]["od"], '__.___')#
in<br>
How can I sort this listing???

quote:
Originally posted by:
NDWebDeveloper
Sorry I will the whole thing is a pricing wizard developed by
a programmer about a year ago. I inherited the code from that
person. Not sure if it is a 2d array or not. I would like the items
sorted by numeric desc. I have a different language translation of
the site and it uses:
#NumberFormat(notStruct
["od"], '__.___')# in<br>
which seems to work.
You have to find out. Do a text search for queue_copy in
whatever you are using to edit your source code, and look for the
first line where it shows up. That should give you a hint.
By the way, if it is a 2D array, you have to know how you
want it sorted. Think of it as a spreadsheet with 10 columns and 20
rows. If you were told to sort that, and were given no other
information, what would you do?

Similar Messages

  • Need help Sorting an Arraylist of type Object by Name

    Hey guys this is my first time posting on this forum so hopefully i do it the right way. My problem is that i am having difficulties sorting an Array list of my type object that i created. My class has fields for Name, ID, Hrs and Hrs worked. I need to sort this Array list in descending order according to name. Name is the last name only. I have used a bubble sort like this:
    public static void BubbleSort(TStudent[] x){
    TStudent temp = new TStudent();
            boolean doMore = true;
            while (doMore) {
                doMore = false;
                for (int i=0; i < x.length-1; i++) {
                   if (x.stuGetGPA() < x[i+1].stuGetGPA()) {
    // exchange elements
    temp = x[i]; x[i] = x[i+1];
    x[i+1] = temp;
    doMore = true;
    before many time to sort an array of my class TStudent according to GPA.  This time though i tried using an Array list instead of just a simple array and i can't figure out how i would modify that to perform the same task.  Then i googled it and read about the Collections.sort function.  The only problem there is that i know i have to make my own comparator but i can't figure out how to do that either.  All of the examples of writing a comparator i could find were just using either String's or just simple Arrays of strings.  I couldn't find a good example of using an Array list of an Object.
    Anyways sorry for the long explanation and any help anyone could give me would be greatly appreciated.  Thanks guys
    Edited by: Brian13 on Oct 19, 2007 10:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    ok still having problems I have this line of code to try and all Arrays.sort
    Arrays.sort(Employee, TEmployee.FirstNameComparator);Then in my class TEmployee i have
    public static Comparator FirstNameComparator = new Comparator() {
        public int compare(Object employee, Object anotherEmployee) {
          String lastName1 = ((TEmployee) employee).getEmpName().toUpperCase();
          String lastName2 = ((TEmployee) anotherEmployee).getEmpName().toUpperCase();     
           return lastName1.compareTo(lastName2);
      };Here is the rundown of what i have for this. I have 2 classes. One is called TEmployee and that class holds fields for Name, ID, Hrs Worked, Hourly Rate. Then i have another class called myCompany that holds an ArrayList of type TEmployee. Then i have my main program in a Jframe.
    So maybe i am putting them in the wrong spots. The code in TEmployee thats make the comparator is fine. However when i try to call Arrays.sort from class myCompany i get this
    cannot find symbol
    symbol: method sort (java.util.Array list<TEmployee>.java.util.Comparator
    location: class java.util.Arrays
    I have to put the comparator in TEmployee right because thats where my fields for Name are? Do i call the arrays.sort from my main program or do i call that from the class myCompany where my ArrayList of TEmployees are stored?
    Again guys thanks for any help you could give me and if you need any code to see what else is going on just let me know.

  • Help Sorting array of strings with numbers in them

    Hello I need to sort an array of Strings of numbers. The order is not what I want it to be. instead of 1, 5, 20 it will go 1, 20, 5.
    I did a google search for this and found some code that could fix this. The only problem is I tried using it as a method in my program and am getting a compile-time error that I'm not sure how to fix.
    C:\Documents and Settings\Owner\Desktop\stringcompare.java:18: '(' or '[' expected
                new Comparator<String>()
                                    ^I'm not sure what to do here. Any help would appreciated.

    import java.io.*;
    class MyProgram{
    //This is my old bubble sort method which screws up with numbers
    public static String[] sort( String[] points)
              boolean keepGoing = true;
              while(keepGoing == true){
                   keepGoing = false;
                   for(int i = 0; i < points.length - 1; i ++)
                        if(points.compareToIgnoreCase(points[i + 1]) < 0)
                             String temp = points[i];
                             points[i] = points[i + 1];
                             points[i + 1] = temp;
                             keepGoing = true;
              return points;
    //This method reads a pre-existing text file
    public static String[] readPoints() throws IOException
              FileReader file = new FileReader("points.txt");     
              BufferedReader in = new BufferedReader(file);
              String temp;                
              String[] list = new String[100];     
              int i = 0;
              while (i < list.length)                    
                   temp = in.readLine();
                   if (temp != null)
                        list[i] = temp;                    
                   else
                        list[i] = " ";
                   i++;
              in.close();                              
              return list;
    //rewrites file after being sorted
         public static void savePoints(String[] points) throws IOException
              FileWriter file = new FileWriter("points.txt");
              BufferedWriter out = new BufferedWriter(file);
              int i = 0;
              while (i < points.length)          // while the end of file is not reached
                   out.write(points[i]) ;
                   out.newLine();
                   i++;
              out.flush();
              out.close();
    public static void main(String[]args) throws Exception{
    String[]points = new String [100];
    points = readPoints();
    points = sort(points);
    savePoints(points);
    for(int i = 0; i < points.length - 1; i++)
    System.out.println(points[i]);
    The problem is that it doesn't sort as I would like it and I'm not sure how to get the comparator to work properly.
    Edited by: myol on May 31, 2008 4:21 PM
    Edited by: myol on May 31, 2008 4:23 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help for array counting

    Any help for array question
    Hello to All:
    I want to tally or count some of the elements that I have in array but not sure how.
    I have for example: int myArray[] = {90,93,80,81,71,72,73,74};My objective is to tally all of the 90's, tally all of the 80's and tally all of the 70's.
    So, the result that I want to have would look something like the following:
    System.out.println ("The total tally number of 90's is " 2 );
    System.out.println ("The total tally number of 80's is " 2 );
    System.out.println ("The total tally number of 70's is " 4 );I do not want to add these numbers, just want to count them.
    Also I want to use a "forloop" to achieve the result intead of just declaring it at 2 or 4 etc..
    Any help Thankyou

    [u]First , This is not exactly what I have to
    do for homework. There is a lot more, a lot more
    involved with the program that I am working on.
    Second, this is an example, an example, an
    example of something that I need to achieve.
    Third, you are asking for a code, to me that
    sounds as if your asking for homework. Fourth,
    I did not ask for any rude comments. Fith, in
    the future please do not reply to my messages at ALL
    if you can not help!!!!
    Sixth, We did not ask for lazy goofs to post here.
    Seventh, In the future please do not post here. Take a hike - there's the virtual door.

  • Need help sorting fil

    i have a brand new MuVo n200
    i need help, i put my cd's in and everyhting and i filled it with songs ans i can play them and everything, but i hate thats itssorted in ABC order. i cannot figure how to put them so it is in order by the CD or the bandname.
    please help.
    message me on aim if you want [email][email protected]][email protected][/url]

    To group the songs into albums or artist groups, I would definitely suggest putting all the tracks from each album/group in its own folder on your PC and put the folder on the muvo in just the same way as you would put a single mp3. The player (in normal play mode) will then play each folder all the way through before moving on to the next one alphabetically (or numerically, if you put numbers at the start of the folder names) and you can then use 'skip folder' to skip through to find the particular album or artist you're looking for. Play around with the shuffle modes too - you can shuffle within folders or just shuffle everything if you want.
    Tracks will normally be played alphabetically. To get them to play in order of track number, put numbers at the beginning of each file name. E.g.: file 'examplesong.mp3' would become '0_ examplesong.mp3' If you've got tonnes of songs and you're worried about it taking ages, the computer will do it for you! Click on 'my computer', then click on 'Muvo N200 media explorer'.. This shows the contents of your player. Choose a folder to reorder the songs in and click on it to display the songs. In the pictures along the top of the window, 4th from the right is an icon with a downward facing arrow and an A above a Z. Click on this, it's called 'custom sort'. You can then use the arrows at the bottom to change the order of your tracks to how you want them. Click OK, and they'll all be numbered in that order!
    For instructions on how to create folders in mediasource, read the thread in this link:
    http://forums.creative.com/creativelabs/board/message?board.id=dap&message.id=926
    I don't think you can put folders within folders in the muvo, but just the one layer really helps organisation.
    Hope that helps!
    x Flaneur
    PS- scroll down in the thread in the link: Jeremy CL was nice enough to give pictures in his instructions! If you'd like more help, type 'create folders' or something into the forum search as there's probably quite a lot of advice kicking about here!Message Edited by flaneur on 03-27-2005 :8 PM

  • Need help: merge array

    Hi everybody
    Need help in merging array of strong edges (coordinates).
    Already using array in 'if else' but have problem in merging those sequence values into two arrays of x and y coordinates (it will take all coordinates in image).
    Any ideas?
    Thanks.
    mySiti
    for (int i = 0; i < width; i++) { //for width
                for (int j = 0; j < height; j++) { //for height
                    Color c = pic.get(i, j);
                    int r = c.getRed();
                    int g = c.getGreen();
                    int b = c.getBlue();
                   int finalEdgeR=0, finalEdgeG=0, finalEdgeB=0;
                   int notEdgeR, notEdgeG, notEdgeB;
                   int [] StrongEdgeCoordX = new int ;
    int [] StrongEdgeCoordY = new int [j];
    if(r>=50 && r<=255)
    finalEdgeR=r;
    System.out.println("--------------------------------");
    System.out.println("coordinate of this pixel '"+i+"'");
    System.out.println("coordinate of this pixel '"+j+"'");
    System.out.println("StrongEdgeCoordX '"+i+"'");
    System.out.println("StrongEdgeCoordY '"+j+"'");
    System.out.println("edge red '"+finalEdgeR+"'");
    else if (r>=0 && r<50) notEdgeR=0;
    if(g>=50 && g<=255)
    finalEdgeG=g;
    System.out.println("edge green '"+finalEdgeG+"'");
    else if (g>=0 && g<50) notEdgeG=0;
    if(b>=50 && b<=255)
    finalEdgeB=b;
    System.out.println("edge blue '"+finalEdgeB+"'");
    else if (b>=0 && b<50) notEdgeB=0;

    hi, i have here a codes but i dont know on how to print the value that stored in array C;
    heres the sample code;
    // your array a and b
    int[] a, b;
    // you fill them
    a = ...;
    b = ...;
    // now you merge them
    int cSize = a.length + b.length;
    int[] c = new int[cSize];
    // pos of the c array
    int count = 0;
    int i = 0;
    for(i = 0; i < a.length; i++){
    c[count++] = a;
    for(i = 0; i < b.length; i++){
    c[count++] = b[i];

  • Need help sorting 2 arrays linked by their indexes

    I have 2 arrays that have been linked by the index of both arrays. The first array has to be sorted alphabetically, so I need a way to sort the 2nd array so that the indices match up again with the first array.
    Now, I cannot change my ArrayList (i.e. TreeSet, List, etc.) since there is lots of code that would have to be changed. Here is my test code. Hopefully everyone is a fan of the television show Friends so that you can see how if I sort the firstName Array alphabetically, then I have to have the 2nd array sorted to be "linked" back to the first array based on the index. I am looking for ideas, but if you have simple code, that would be great too.
    import java.util.*;
    public class Test
         public static void main(String[] args)
              System.out.println("BEGIN TEST...");
    Test test = new Test();
    test.beginTest();
    System.out.println("\nTEST COMPLETE!");
         public Test(){}
         public void beginTest()
              ArrayList firstName = new ArrayList();
              ArrayList lastName = new ArrayList();
              //Add to firstName ArrayList
              firstName.add("Ross");
              firstName.add("Chandler");
              firstName.add("Rachel");
              firstName.add("Phoebe");
              firstName.add("Joey");
              //Add to lastName ArrayList
              lastName.add("Geller");
              lastName.add("Bing");
              lastName.add("Green");
              lastName.add("Buffay");
              lastName.add("Tribbiani");
              try
                   System.out.println("TESTING...\n");
                   for(int index=0; index<firstName.size(); index++)
                        String first = firstName.get(index).toString();
                        String last = lastName.get(index).toString();
                        System.out.println("Hi, I am " + first + " " + last + ".");                    
              catch(Exception X) { System.out.println("EXCEPTION! "+X); X.printStackTrace(); }
    }

    Keeping the list in synch is conceptually easy.
    Basically anything you do to the one List, you have to do to the other in order to keep them consistent.
    How are you sorting your "firstnames" list?
    Using the Collections.sort method, or some manual coding?
    Would it be possible to change your datastructure from "parallel arrays" to "List of people objects"
    iepublic class Person {
      String firstName;
      String lastName;
      public Person(String firstName, String lastName){
        this.firstName = firstName;
        this.lastName = lastName;
      // appropriate getter/setter methods
    }Then you could build up your list like this:
    List friends = new ArrayList();
    friends.add(new Person("Ross", "Geller"));
    friends.add(new Person("Chandler", "Bing"));
      ...Now when you sort the list, the last name always goes with the first name because they are in the same object.
    You then write different Comparator objects to impose different orderings.
    Hope this helps,
    evnafets

  • I need help sorting an Array.

    Hi, I need to make a program that reads a string (sentence), then it counts the number of times each letter is "typed". As an optional challenge, the teacher told us to sort the results from the most repeated, to the least.
    My program is working pretty well, here is the code:
    import java.lang.String;
    //import java.util.Collections;
    //import java.util.*;
    public class count {
         final int alpha = 66;
         int [] lower = new int [alpha];
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              java.util.Scanner in = new java.util.Scanner (System.in);
              char current;
              final int alpha = 66;
              int [] lower = new int [alpha];
              int Spaces = 0;
    System.out.println("Enter a sentence:");
    String line = in.nextLine ();
    //int length = line.length();
    line = line.toLowerCase();
    for (int ch = 0; ch < line.length(); ch++)
    current = line.charAt(ch);
    if (current >= 'a' && current <= 'z')
    lower[current-'a']++;
    else if (current == ' ')
    Spaces ++;
    System.out.println();
    for (int letter=0; letter < lower.length;letter++)
         if (lower[letter]>0){
    System.out.print((char)(letter + 'a'));
    System.out.println(": " + lower[letter]);
         System.out.println ();
         System.out.println ("Spaces: " + Spaces);
         }[now, I want to sort the results. I tried using Arrays.sort(lower); but it doesnt work as it should. Example:
    String: Hello
    not sorted:
    e: 1
    h: 1
    l: 2
    o: 1
    Spaces: 0
    "sorted":
    : 1
    .:1
    ]:1
    ~:2
    Spaces: 0
    I would really appreciate your help.
    Thanks, J. Flemming

    Since you didn't post your Arraays.sort code, I can't
    tell what you did wrong.
    What does your array store? Element 0 is the number
    of 'a' occurences, 1 is 'b', etc?
    If so, then when you sort that, you'll have no idea
    which element corresponds to 'a'. You'll need a
    different approach for that. For instance, a class
    that encapsulates two pieces of data: character and
    number of occurences. You could then implement your
    own sort, or learn how to use Comparable/Comparator.
    Making Java
    Objects Comparable
    http://java.sun.com/docs/books/tutorial/collections/in
    terfaces/order.html
    http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-
    sort.htmlAs I said in my original post, I used Arrays.sort(lower), which is probably wrong. My Arrays does work as you described, element 0 is the numer of occurrences of 'a', and 1 is the number of occurrences of 'b' and so on. Thanks for your responce. Im looking into what you said. Thanks again.
    Message was edited by:
    Flemm.John

  • Need Help with Array.sort and compare

    Hi
    I have a big problem, i try to make a java class, where i can open a file and add new words, and to sort them in a right order
    Ok everthing works fine, but i get a problem with lower and upper cases.
    So i need a comparator, i tried everything but i just dont understand it.
    How do i use this with Array.sort??
    I hope someone can help me

    Okay, you want to ignore case when sorting.
    There are two possibilities: Truly ignore case, so that any of the following are possible, and which one you'll actually get is undefined, and may vary depending on, say, which order the words are entered in the first place:
    English english German german
    english English german German
    English english german German
    english English German german
    The second possibility is that you do consider case, but it's of lower priority--it's only considered if the letters are the same. This allows only the first two orderings above.
    Either way, you need to write a comparator, and call an Arrays.sort method that takes both array and Comparator.
    The first situation is simpler. Just get an all upper or lower case copy of the strings, and then compare thosepublic int compare(Object o1, Object o2) {
        String s1 = ((String)o1).toUpper();
        String s2 = ((String)o1).toUpper();
        return s1.compareTo(s2);
    } You'll need to add your own null check if you need one.
    For the second way, your comparator will need to iterate over each pair of characters. If the characters are equal, ignoring case, then you compare them based on case. You pick whether upper is greater or less than lower.
    Of course, the need to do this assumes that such a method doesn't alrady exist. I don't know of one, but I haven't looked.

  • Noob needs help with array manipulation

    First off, I'd like to say hello to eveybody!
    I'm trying to figure out how to search for a value in an array, delete the first occurence of it, and shift the rest of the array down one. Can anyone point me in the right direction of an algorithm, mabey?
    Any help is most appreciated!

    first of all, let me comment that for this purpouse, you're better using the ArrayList class.
    anyway, you would need to make a temporary array inside a method, and traverse the array in question using a loop. most people use a for loop.
    Then, put all the values of the old array into the temporary one, except for the one you dont want.
    after the loop, set the old array to equal the temporary array.

  • Need Help with Arrays/Text

    I'm trying to create a flash program that uses it's own code to send and create images. Each square has a colour and that colour gets added into the array. A black, then grey, then white is:
    filecode = ["Bl", "Gr", "Wh"];
    That works fine, but when I try to paste it into an Input text box it will only fill in the first part of the array.
    filecode = ["Bl,Gr,Wh"];
    So the program has NO idea what I want.
    The only ways I can think of fixing this is by putting in 402 text boxes to suit every box...But every one of them needs a Variable Name.
    Or by sending the information straight into the array. But this way you are just looking at what you just drew, and that is not at ALL practical.
    Helping me with this headache will be greatly apprectiated.
    FlashDrive100.

    If you can explain the first part of your posting it might become a little clearer what you are trying to do and what isn't working... particularly this...
    " when I try to paste it into an Input text box it will only fill in the first part of the array."
    I can't speak for anyone else, but at this point, I share your file's problem... not knowing what you want.

  • Need help sorting an ArrayList of strings by an in common substring

    I'm trying to sort a .csv file, which I read into an ArrayList as strings. I would like to sort by the IP address within the string. Can someone please help me figure out the best way to sort these strings by a common substring each has, which is an IP address.
    I'm pretty sure that I need to use Collections some how, but I don't know where to begin with them besides trying to look online for help. I had no luck finding any good examples, so I came here as a last resort.
    Thanks for any help provided.

    You need to write your own Comparator class. In the compare() method you substring out the two IP addresses, compare them and return appropriate value. Then you call Collections.sort() and pass your list and comparator.

  • Java Intro student needs help on arrays

    As my first assignment I have created a program called RobotRat which has a "Rat" move north, south, east, or west on an array floor. I have the program running but am having trouble creating my "floor" using a two-dimensional array. My teacher also wants us to use boolean values for our array. I am drawing a blank on how to create this. From my books I have gathered the following code but cannot get it to work. Any help would be greatly appreciated:
    1.public class RobotRatArray
    2.{
    3.
    4. dataType RobotRatArray[] [];
    5. int matrix [] [];
    6. matrix = new int [20] [20];
    7.
    8.
    9.}

    Okay, I just spoke with a classmate of mine and they said my array isn't in another window. I need to do some system.out.print commands so they print out on my dos window. I am just so confused with this program. I am going to copy and paste it in here in case anyone has any guidance for me. It would be greatly appreciated. (Sorry, I can't figure out how to get my line numbers to populate from textpad when I paste in this message)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class RobotRat extends JFrame implements ActionListener
         private JPanel panel1 = null;
         private JPanel panel2 = null;
         private JPanel panel3 = null;
         private JLabel label1 = null;
         private JLabel label2 = null;
         private JLabel label3 = null;
         private JTextField textfield1 = null;
         private JButton button1 = null;
         private JButton button2 = null;
         private JButton button3 = null;
         private JButton button4 = null;
         private boolean[][] floor = null;
         private int current_column = 21;
         private int current_row = 21;
         private static final int UP = 1;
         private static final int DOWN = 0;
         private static final int NORTH = 0;
         private static final int EAST = 1;
         private static final int SOUTH = 2;
         private static final int WEST = 3;
         private int pen_position = UP;
         private int rats_direction = EAST;
    public RobotRat()
    super("RobotRat");
    label1 = new JLabel("Spaces: ");
    textfield1 = new JTextField(40);
    button1 = new JButton("Move North");
    button2 = new JButton("Move South");
    button3 = new JButton("Move East");
    button4 = new JButton("Move West");
    button1.addActionListener(this);
    button2.addActionListener(this);
    button3.addActionListener(this);
    button4.addActionListener(this);
    this.getContentPane().setLayout(new FlowLayout());
    this.getContentPane().add(label1);
    this.getContentPane().add(textfield1);
    this.getContentPane().add(button1);
    this.getContentPane().add(button2);
    this.getContentPane().add(button3);
    this.getContentPane().add(button4);
    this.setSize(600, 100);
    this.setLocation(100, 100);
    this.show();
    public void togglePen()
         switch(pen_position)
              case (UP): pen_position = DOWN;
              label1.setText("DOWN");
              break;
              case (DOWN): pen_position = UP;
              label1.setText("UP");
              break;
              default: break;
    public void turnLeft()
         switch(rats_direction)
              case NORTH: rats_direction = WEST;
              label3.setText("WEST");
              break;
              case EAST: rats_direction = NORTH;
              label3.setText("NORTH");
              break;
              case SOUTH: rats_direction = EAST;
              label3.setText("EAST");
              break;
              case WEST: rats_direction = SOUTH;
              label3.setText("SOUTH");
              break;
    public void move()
         int spaces_to_move = 0;
         try
              spaces_to_move=Integer.parseInt(textfield1.getText());
         catch(Exception e)
         switch(pen_position)
              case UP:
                   switch(rats_direction)
                        case NORTH: ;
                        case SOUTH: ;
                        case WEST: ;
                        case EAST: ;
              break;
              case DOWN:
                   switch(rats_direction)
                        case NORTH: ;
                        case SOUTH: ;
                        case WEST: ;
                        case EAST: ;
              break;
    public void actionPerformed(ActionEvent e)
         if (e.getActionCommand().equals("TogglePen")) {
         togglePen();
         else if (e.getActionCommand().equals("TurnLeft")) {
         turnLeft();
    public static void main(String[] args)
         RobotRat rr = new RobotRat();

  • Need Help : BubbleSort & Array

    Hi , sorry to ask for help in some codes area.
    My project is near finish in regards to the last part of the ranking.
    My project is about a game that can support 2 players and determine the winner after the person guess correctly the spot .
    I am able to do till the end of every logics , just that i left the ranking part.
    My ServerModel will record the records into a file call summary.txt
    record goes by only record winner in this format :
    playerName,numberOfGuess
    I was advised to use this format to do the sorting to display TOP 3 in the simplest form
    Method 1 :
    1stly => //Read the file
    2ndly => //Stringtokenizer split into 2 tokens
    3rdly =>
    // store 1st token into arrayScore[i]
    //store 2nd token into arrayName[i]
    //use the compare max score of 3 winners ascending for arrayScore[i]
    //loop --- find the 1st 3 players
    // int win1; int win2 ; int win3;
    //Display top scorer arrayame[ win1] ;
    Method2 :
    // BubbleSort sort for integer scoreArray[i]
    //...... temp = scoreArray;
    // scoreArray[i] = scoreArray[i+1] ;
    // scoreArray[i+1] = temp ;
    //...... temp2 = scoreNAme[i];
    // scoreName[i] = scoreNamei+1] ;
    // scoreName[i+1] = temp2 ;
    I would like to ask which you think would be easier to use and anyone can show me a code sample on how to do the following method u think would be easier for my project.
    PS: I just a begineer java programner . Thanks for the help.

    I was advised to use this format
    // store 1st token into arrayScore
    //store 2nd token into arrayNameYou where advised "NOT" to use that format. You where told it was a terrible solution.
    Not only that you have been told the better solution and told how to use Comparators.
    So I'm not going to waste time again giving a solution that will be ignored.
    You have been told to use the sort methods supported by the Collections class. There is no need to write your own sort routines.

  • Need help sorting /consolidating music. 3 external hard drives 25000+ songs

    i have 3 external hard drives 1 terabite each. over 2000 complete albums. i may have 20 different folders or files of music spread over each drive. how do i clean up the music. example (folder a)has 700 albums and 1000 single songs by various artists, including 5 single copies of the song back in black by ac/dc. this folder includes 9 full ac/dc albums. (folder b) has 1500 albums and 2000 singles and has 14 ac/dc albums when i run (folder a) thru itunes and it completes and all music data shows. i then will run (folder b) thru i tunes, but i do not want 9 ac/dc back in black singles off the album back in black, nor do i want 2 complete back in black albums, 2 highway to **** albums and so forth, i want itunes to only install the 5 albums that are not in (folder a). please help.

    Welcome to the Apple discussions.
    You may want to consider posting this question in the iTunes discussion area at http://discussions.apple.com/category.jspa?categoryID=149
    It sounds like you don't currently back up your hard drive, and if your iTunes library is that important to you, you should figure out how to back it up now. Easiest way is to buy an external drive larger than your existing internal hard drive, get a program like SuperDuper, which is what I use, and copy your drive to the external backup. Then you can point iTunes to it to use the library there. SuperDuper can be found at http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html
    I prefer an external hard drive with a firewire connection, so I can boot from it if need be (a Powerbook can't boot from a USB device). If you do get an external hard drive with only a USB connection, then it would be good for it to have it's own power supply since some drives can't get enough power from the Powerbook USB to start or work properly.

Maybe you are looking for