Java School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a Java Expert!

Join 300,492 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,827 people online right now. Registration is fast and FREE... Join Now!




2-Dimension Array Sorting

 

2-Dimension Array Sorting

Synth

1 Nov, 2007 - 10:15 PM
Post #1

New D.I.C Head
*

Joined: 29 Aug, 2007
Posts: 44



Thanked: 1 times
My Contributions
i have a two dimensional array and i'm trying to sort each column at a time. this is what i have for it right now:
CODE

input = JOptionPane.showInputDialog(null, "Please enter your polynomial equation.");
                 input = input.replaceAll("\\s+", "").replaceAll("\\(", " ").replaceAll("\\)", " ");
                             
                 StringTokenizer tokenizer = new StringTokenizer(input);
                while(tokenizer.hasMoreTokens())
                {
                    first[count] = (tokenizer.nextToken());
                    count++;
                }
                 
                 first[0] = first[0].replaceAll("x", "").replaceAll("X","").replaceAll("\\^", " ").replaceAll("\\+", " ").replaceAll("\\-", " -");
                tokenizer = new StringTokenizer(first[0]);
                len = first[0].length() / 2;
                Double[][] in1 = new Double[len][2];
                while(tokenizer.hasMoreTokens())
                {
                    if(col == 1)
                    {
                        col = 0;
                    }
                    
                    else
                    {
                        in1[row][col] = Double.parseDouble(tokenizer.nextToken());
                    }
                    
                    row++;
                }
                                                                //heres where im trying to sort it.
                in1 = Arrays.selectionSort(in1);


it gives me the error:

CODE

--------------------Configuration: <Default>--------------------
G:\Java\token5.java:55: cannot find symbol
symbol  : method selectionSort(java.lang.Double[][])
location: class java.util.Arrays
                in1 = Arrays.selectionSort(in1);
                            ^
1 error


am i doing something wrong in the coding or is this not workable with a two dimmensional array?


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 04:32AM

Live Java Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month