Interview Solution

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. C.A.R. Hoare

Verify Sorted

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

Check an array of integers is sorted or not.
Write program to verify the array of elements is sorted or not
Example:-
Given array "[1,4,5]" return true
Given array "[1,5,4]" return false


Output

   					 
Array:[12, 56, 24, 34]:false
Array:[1, 2, 3, 4, 5]:true

				    

Comments



Please login to add comments.