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_...
In questa pagina del sito puoi guardare il video online Binary Search with example - Algorithm della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Abdur Rakib 29 novembre 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 81 volte e gli è piaciuto 0 spettatori. Buona visione!