SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   def SortingChecker(list: List[Int]): Boolean = {
  2.     def helperFunction(acc: Boolean, list: List[Int]): Boolean = {
  3.       if (!acc) return acc
  4.       if (list.length == 1) return acc
  5.       else if (list.length == 2) list.head < list.last
  6.       else helperFunction(list.head < list.tail.head, list.tail)
  7.     }
  8.  
  9.     helperFunction(true, list)
  10.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top