palsubho801-create/Beginner-Tasks-Repo

Implement a Binary Search Function in C

Ouverte

#23 ouverte le 16 oct. 2025

 (2 commentaires) (0 réaction) (0 personne assignée)C (4 forks)auto 404
hacktoberfest

Métriques du dépôt

Stars
 (0 étoile)
Métriques de merge PR
 (Métriques PR en attente)

Description

Create a new file named 'binary_search.c' that implements the Binary Search algorithm.

Requirements:

  1. The function must assume the input array is already sorted.
  2. It should return the index of the target element if found, or -1 otherwise.
  3. Include a main function to test the search on a hardcoded sorted array.

Guide contributeur