This website is preserved for historical and scholarly reference and is no longer actively maintained.

QUIZ 1

January 7, 1998

Given an array mArray, containing integer values, write code that will decide whether or not the array mArray is sorted in ascending order. (If mArray is sorted in ascending order, then mArray[0] < mArray[1] < ... < mArray[k] < mArray[k+1] < ... < mArray[mArray.length-2]).

That is, you want to write a boolean function that returns true if mArray[k] < mArray[k+1] for k = 0, 1, ..., mArray.length-2; otherwise, the function returns false.



Return to Eleanor Hare's home page.

Return to Department of Computer Science Home page.