Question: Write an Erlang function named sorted that takes one parameter, a list. The function should return true if the list is sorted (from low to

Write an Erlang function named sorted that takes one parameter, a list. The function should return true if the list is sorted (from low to high), and should return false if it is not sorted. For example, calling sorted( [1,3,5,5,10] ) should return true, while calling sorted( [2,3,4,5,2] ) should return false. If the parameter is not a list, the function should return error.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!