a) Implement a function that examines an array and returns 0 or 1, where 0 indicates the array is unsorted and 1 indicates the array is sorted.
b) If array is unsorted, Implement a selection sort that removes duplicates during the sorting process.
please who has the function please post here the method
Could you just loop through the elements in the array and run a comparison of each against the previous element which returns false if one is out of order?
I m confuse about your question Almutasim. Do you want to sort some number is array or something else.
Hello my friend I am sorry, maybe my question is not clear but I will try to explain it step by step
I want to write a java code to check whether the array(any array ) is sorted or not
if sorted return 1 and if the array is unsorted return 0
return means like (System.out.println)
That was about the first part that say ( a) Implement a function that examines an array and returns 0 or 1, where 0 indicates the array is unsorted and 1 indicates the array is sorted. )
Bookmarks