Skip to content

SortArray_CountOccurences

Sancky edited this page May 1, 2023 · 2 revisions

Description

Count occurences for a specific element from the sorted array.

Syntax

SortArray_CountOccurences(array[], value)

Example

new SortedArray:array<10>;

SortArray_Insert(array, 1);
SortArray_Insert(array, 5);
SortArray_Insert(array, 7);
SortArray_Insert(array, 7);
SortArray_Insert(array, 7);
SortArray_Insert(array, 10);
SortArray_Insert(array, 15);

printf("Occurences count for element 7: %d", SortArray_CountOccurences(array, 7));

Returns

Returns the count.

Clone this wiki locally