logo CodeStepByStep logo

Sorted

Language/Type: C# arrays traversals

Write a method named Sorted that accepts an array of doubles as a parameter and returns true if the list is in sorted order and false if not. For example, if an array named list stores {1.5, 4.3, 7.0, 19.5, 25.1, 46.2} respectively, the call of Sorted(list2) should return true. You may assume the array has at least one element. A one-element array is considered to be sorted. Do not modify the array passed in.

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.