Binary Search in Python: Find Fixed Point

preview_player
Показать описание
In this video, we will be solving the following problem:

Given an array of n distinct integers sorted in ascending order, write a function that returns a "fixed point" in the array. If there is not a
fixed point return "None".

A fixed point in an array "A" is an index "i" such that A[i] is equal to "i".

This video is one part of the Binary Search playlist on my channel. For more videos on binary search and how to apply it to various problems, check out the other videos:

The software written in this video is available at:

Do you like the development environment I'm using in this video? It's a customized version of vim that's enhanced for Python development. If you want to see how I set up my vim, I have a series on this here:

If you've found this video helpful and want to stay up-to-date with the latest videos posted on this channel, please subscribe:
Рекомендации по теме
Комментарии
Автор

What will be the approach to solve this ques if duplicates are allowed?

ayushidalal
Автор

I never write a comment but I couldn't help myself. I went through enough videos for Algorithm in Python and yours are the best by far. It is so thorough and precise, I repeated each video probably about twice and I can write it out of scratch even three days later. Thank you very much!

liveToRadiance
Автор

What if there are multiple fixed points?

supriyosarkar
Автор

We need to also assume that we only have one fixed point in the array right? Because like having duplicates, this method should also not work for multiple fixed points.

samarthbhandari
Автор

nothing else just here, to thank you .

adityagedam
visit shbcf.ru