Binary Search with example - Algorithm

Опубликовано: 29 Ноябрь 2017
на канале: 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_...


На этой странице сайта вы можете посмотреть видео онлайн Binary Search with example - Algorithm длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Abdur Rakib 29 Ноябрь 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 81 раз и оно понравилось 0 зрителям. Приятного просмотра!