Divide and Conquer: Binary Search with Swift Tutorial | Brian Advent

preview_player
Показать описание
➡️ From Design to Code Course: Just $29.99 ⬅️

Learn how to implement binary search algorithm, what divide and conquer and time complexity means.

✉️ COMMENTS ✉️
If you have questions about the video or Cocoa programming, please comment below.
Рекомендации по теме
Комментарии
Автор

This works only when the array is sorted. In the real world, this is almost never the case.
Also, there is no need for a counter to print the iterations. The playground prints the number on the left side.
Brian, love your videos! Very clean and understandable tutorials!

sami
Автор

Very good demonstration of two different concepts. Thanks for your work, Brian!

vandanpatel
Автор

Thank for this tutorial with simple explanation! You're awesome! 😎

danielprast
Автор

Love this more theoretical tutorial! Keep up the good work!

Herman-geux
Автор

Awesome content to share! Please, it would be great to have more. Thanks!

lecomp
Автор

In last if statement range should be range.startIndex ..< midpoint

MegaNulls
Автор

Hi. Shouldn't line 33 read 'range = range.startIndex ..< midpoint' instead of 'range = 0 ..< midpoint'?

bfras
Автор

I don't believe this is divide and conquer. It would need "two disjoint recursive calls". Binary search divides the problem but does not solve each of the divided halves recursively. Not sure tho :)

TheUniqueGamingTV
visit shbcf.ru