Practice ยท 3 of 4
Read-Only In, Write Out
Implement the const-discipline pair:
``c
/* returns a NEW heap array holding a's elements sorted ascending;
a is never modified. Caller owns the result (frees it).
Returns NULL for NULL input or allocation failure. */
int *sorted_copy(const int *a, size_t n);
/* returns 1 iff a is already sorted ascending */
int is_sorted(const int *a, size_t n);
``
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Address Walking Gym