Зміст курсу
Binary Search in Python
Binary Search in Python
1. Binary Search
Division
Look at the explanation of the task! How does it work?
Use hints if needed! Be careful with the tabulation!
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Все було зрозуміло?
Секція 2. Розділ 5
Division
Look at the explanation of the task! How does it work?
Use hints if needed! Be careful with the tabulation!
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Все було зрозуміло?
Секція 2. Розділ 5
Division
Look at the explanation of the task! How does it work?
Use hints if needed! Be careful with the tabulation!
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Все було зрозуміло?
Look at the explanation of the task! How does it work?
Use hints if needed! Be careful with the tabulation!
Завдання
- Set condition if the
y
equals the0
. - Set the
middle
variable. Themiddle
equals theleft + (right - left) // 2
. - Return the product of the
middle
and thesign
. - Update the
left
. Theleft
equals themiddle
. - Update the
right
. Theright
equals themiddle
. - Test the function with the
x = 9
andy = 3
.
Секція 2. Розділ 5
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів