data_structures
Functions
array_sorted.c File Reference
#include "array.h"
+ Include dependency graph for array_sorted.c:

Go to the source code of this file.

Functions

int array_sorted (const t_array *array)
 Checks if an array is sorted in ascending order. More...
 

Function Documentation

◆ array_sorted()

int array_sorted ( const t_array array)

Checks if an array is sorted in ascending order.

Returns
1 if the array is sorted, 0 if the array is not sorted.
Note
For this function to work, the datatype in this array must be comparable (i.e. implement the cmp function).

Definition at line 16 of file array_sorted.c.