Binary Search with example - Algorithm

Publicado el: 29 noviembre 2017
en el canal de: 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_...


En esta página del sitio puede ver el video en línea Binary Search with example - Algorithm de Duración hora minuto segunda en buena calidad , que subió el usuario Abdur Rakib 29 noviembre 2017, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 81 veces y le gustó 0 a los espectadores. Disfruta viendo!