Binary Search with example - Algorithm

Veröffentlicht am: 29 November 2017
auf dem Kanal: Abdur Rakib
81
0

what is the difference between mid=start+(end-start)/2 and mid=end/2 ,where start is always zero
(question by Shofiul Islam.)

answer:

what is Segmentation fault?
-A common run-time error for C programs by beginners is a "segmentation violation" or "segmentation fault." When you run your program and the system reports a "segmentation violation," it means your program has attempted to access an area of memory that it is not allowed to access.

more details: A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core. Segfaults are caused by a program trying to read or write an illegal memory location.

**But you can use mid = (start+end)/2**

Algorithm. • Definition: an algorithm is a finite sequence of instructions, a logic and explicit step-by-step procedure for solving a problem starting from a known beginning.

In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array.

more details:
https://en.wikipedia.org/wiki/Binary_...


Auf dieser Seite können Sie das Online-Video Binary Search with example - Algorithm mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Abdur Rakib 29 November 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 81 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!