Bootcamps
Masterclasses
Menu
Courses
Account
Login / Sign Up

Check Array is Sorted

Basic Acceptance 80% Points 10

You are given an array arr[] of integers. Your task is to check whether the array is sorted in non-decreasing order using recursion only. You are not allowed to use any loops.

Examples
Example 1

Example 1

Input: arr[] = [10 20 30 40 50 60]

Output : true Explanation: The Array Is Sorted

Example 2

Example 2

Input: arr[] = [ 90 80 60 70 40 100]

Output: false

Explanation: The Given Array is Not Sorted

Constraints
  • 1 < n < 105
  • -109 < arr[i] < 109
Topics
Recursion
Companies
Apple Samsung BNY Mellon
Added 19 Jul 2026 80% acceptance
Ln 1, Col 1Sign in to save your code
1 2 3 4 5
Sorted