This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

How to check StringArray is sorted or not?  RSS feed

 
Vass Lee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Report post to moderator

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
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Report post to moderator

Hi Weng Keong Chan,

Thakns for your response.

Can you provide any sample ?


Thanks,

Vass Lee
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please UseOneThreadPerQuestion
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15860
80
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Let's continue this in your other copy of this question.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!