C Program to implement Binary Search || Coding Guide for Beginners|| #programming

preview_player
Показать описание
Hey everyone..

Here we've shown how to implement binary search using C program. Here the user input should be a sorted array. The program will print the location where the element will be found.
.
.
If you like this video, give it a thumbs up..& also do let me know about your thoughts through the comment section.

Subscribe if you want to & click the bell icon to get the notifications.
Рекомендации по теме
Комментарии
Автор

You gave my assignment answer. Now, I don't need to expentidture much time.🙂

suhanjoni
Автор

In your code if you put uneven elements in your array and you target let's say number at index 3, your program will loop forever. So it is better to round your mid to the nearest integer : mid = (int) round((low+high) /2); and include math.h lib.
good explanation thank you
edit: you can also put your mid calculation inside while loop so you don't need to type it again inside else statement.

orplcuf
Автор

Silent teacher who teachs us to understand c program


Thank you so much sir!
Great job u doing
Grow more. Teach more


And sry my English is little bad
What I feel that right I wrote😊

saklen-htv
Автор

please make video on recursive function in binary search

pawanpt
Автор

Hello!
Thank you for the video, it really helped me!
Greetings from Mexico!

Guzkayx
Автор

Sir, how about we write the largest values to smallest value in binary search in array? Can u teach us?

domxz
Автор

Aren't we supposed to refresh the mid variable in the first if statement ? Like the following :

if(array[mid] < a){
low = mid+1;
mid = (low + high)/2;
}

CoffeeTimeGX
Автор

how it is working ? shouldn't we include mid = (low+high)/2 inside while loop statement

sj
Автор

sir the program is not running properly

rupayansen
Автор

at starting it is showing private identifyier is not allowed

allapuramvishwas
Автор

Why count in array did not start from 0, why it started from count 1 though you give the input low equal 0🤔🤔

dhrubajyotighosh
Автор

Excuse me, please explain this program.

shilpashreed