Skip to main content

Practice · 3 of 3

First >= Threshold

CHALLENGE
Difficulty: beginner+25 XP

On an ascending array, implement int first_ge(const int *a, int n, int t) returning the index of the FIRST element >= t, or -1 if none. (Binary search variant — linear is acceptable but halving is the habit to build.)

Back to lesson: Practice: Search Practice