computer scienceWrite a method called `isSorted` that accepts an array of real
numbers as a parameter and returns `true` if the list is in
sorted (nondecreasing) order and `false` otherwise. For
example, if arrays named list1 and list2 store [16.1, 12.3,
22.2, 14.4] and [1.5, 4.3, 7.0, 19.5, 25.1, 46.2]
respectively, the calls `isSorted(list1)` and `isSorted(list2)`
should return `false` and `true` respectively. Assume the array
has at least one element. A one-element array is considered
to be sorted. 5th EditionJack T. Marchewka346 solutions
5th EditionJack T. Marchewka346 solutions
3rd EditionCharles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen726 solutions
5th EditionJack T. Marchewka346 solutions