binary search

PPTX 20 стр. 359,5 КБ Бесплатная загрузка

Предварительный просмотр (5 стр.)

Прокрутите вниз 👇
1 / 20
binary search binary search algorithms and data structures course binary search in computer science, binary search is a search algorithm that finds the position of a target value within a sorted array. examples: seeking word in dictionary algorithms and data structures course binary search binary search compares the target value to the middle element of the array: if the target value matches the element, its position in the array is returned. if the target value is less than the element, the search continues in the lower half of the array. if the target value is greater than the element, the search continues in the upper half of the array. if the search ends with the remaining half being empty, the target is not in the array. by doing this, the algorithm eliminates the half in which the target value cannot lie in each iteration. algorithms and data structures course binary …
2 / 20
8 binary search example algorithms and data structures course need to find number 30 in the array: index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 array 1 3 4 6 7 9 12 14 15 18 26 28 30 32 33 38 14 is smaller than 30, so we eliminating left part of array by making binary search example algorithms and data structures course need to find number 30 in the array: index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 array 1 3 4 6 7 9 12 14 15 18 26 28 30 32 33 38 14 is smaller than 30, so we eliminating left part of array by making binary search example algorithms and data structures course need to find number 30 in the array: index 0 1 2 3 …
3 / 20
e need to find number 30 in the array: index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 array 1 3 4 6 7 9 12 14 15 18 26 28 30 32 33 38 binary search example algorithms and data structures course need to find number 30 in the array: index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 array 1 3 4 6 7 9 12 14 15 18 26 28 30 32 33 38 30 is equal to 30, so we found needed index which is 12 binary search complexity algorithms and data structures course on each step algorithm divides array into two almost equal parts. let’s compute number of actions performed by algorithm: let’s suppose that length of array is . so must be equal approximately , where is number …
4 / 20
binary search - Page 4
5 / 20
binary search - Page 5

Хотите читать дальше?

Скачайте все 20 страниц бесплатно через Telegram.

Скачать полный файл

О "binary search"

binary search binary search algorithms and data structures course binary search in computer science, binary search is a search algorithm that finds the position of a target value within a sorted array. examples: seeking word in dictionary algorithms and data structures course binary search binary search compares the target value to the middle element of the array: if the target value matches the element, its position in the array is returned. if the target value is less than the element, the search continues in the lower half of the array. if the target value is greater than the element, the search continues in the upper half of the array. if the search ends with the remaining half being empty, the …

Этот файл содержит 20 стр. в формате PPTX (359,5 КБ). Чтобы скачать "binary search", нажмите кнопку Telegram слева.

Теги: binary search PPTX 20 стр. Бесплатная загрузка Telegram