Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Arrays Intersection | Problems
Binary Search in Python
course content

Зміст курсу

Binary Search in Python

Binary Search in Python

1. Binary Search
2. Problems

Arrays Intersection

Now we will try to create a program that will find the intersection of the 2 arrays.

Look at the explanation of the task! How does it work?

Use hints if needed! Be careful with the tabulation!

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 2
toggle bottom row

Arrays Intersection

Now we will try to create a program that will find the intersection of the 2 arrays.

Look at the explanation of the task! How does it work?

Use hints if needed! Be careful with the tabulation!

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 2
toggle bottom row

Arrays Intersection

Now we will try to create a program that will find the intersection of the 2 arrays.

Look at the explanation of the task! How does it work?

Use hints if needed! Be careful with the tabulation!

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Now we will try to create a program that will find the intersection of the 2 arrays.

Look at the explanation of the task! How does it work?

Use hints if needed! Be careful with the tabulation!

Завдання

  1. Set while loop to work while the left is lower than the right.
  2. Set the middle variable. The middle equals the (left + right) // 2.
  3. Set the condition if the middle element is greater or equals the x.
  4. Update the left. The left equals the middle + 1.
  5. Create an empty array to fill it with values to test the function.
  6. Set for loop to work with the nums array.
  7. Append the i to the intersection_nums.
  8. Print the intersection_nums.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 2
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt