| Author |
How to check StringArray is sorted or not?
|
Vass Lee
Greenhorn
Joined: Nov 16, 2011
Posts: 8
|
posted

0
|
Hi All,
I am new guy for JAVA. I want to check my String Array is sorted or not ? how can i achieve this ?.Any one give some sample ?
Here i want to check str is sorted or not ?.Values are stored in alphabetical ascending order or not ?
Thanks,
Vass Lee
|
 |
Weng Keong Chan
Greenhorn
Joined: Dec 05, 2011
Posts: 1
|
posted

0
|
|
Sort the input array using Arrays.sort, then compare the resulted array with the input array, if they are the same, the input array is sorted..
|
 |
Vass Lee
Greenhorn
Joined: Nov 16, 2011
Posts: 8
|
posted

0
|
Hi Weng Keong Chan,
Thakns for your response.
Can you provide any sample ?
Thanks,
Vass Lee
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1776
|
posted

0
|
|
Please UseOneThreadPerQuestion
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
|
posted

0
|
|
Let's continue this in your other copy of this question.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: How to check StringArray is sorted or not?
|
|
|