Binary Search with C++ STL | 4 Problems followed up | Lower Bound and Upper Bound explained

preview_player
Показать описание

In case you are thinking to buy courses, please check below:

---------------------------------------------------------------------------------------------------------------------------------------------------- Binary Search is one of the most widely used algorithms in programming. Its good to know some shortcuts which saves a lot of time in Contests. However, in interviews it is highly advised to code Binary Search.

At 0:50 I said a+n points to the last element, it will be it points to after the last element, also the function takes range [Start, end). which means takes the starting element, and excludes the last element.

Please subscribe to the channel if you have not done it. Do leave a like and a comment, as YouTube recommends videos with more likes and comments.
 
Join out telegram channel to interact directly with me. Thanks!

Рекомендации по теме
Комментарии
Автор

the end pointer points to the element after the last element, like a.end() will point to the element after the last element.. also a + n will point to the nth element (which doesn't actually exist, it's a theoretical end position).. the pointers point like [start, end)..

utsavsingh
Автор

Whether you are doing an interview or working on your project, always stick to the STL. The algorithms in STL are written in the most optimized way. They can outperform the same algorithms written in C. That’s the promise of STL: either it runs faster than C code or at least not slower than C.

Sobioytccc
Автор

The way you simplified the explanantion is amazing!

Nishi-Tiwari
Автор

what a coincidence sir I was learning this STL a few minutes ago and you make a video on this thanks a lot sir!!

deepakkoushal
Автор

Yesterday I was getting TLE on a problem because I was doing linear search, and decided to learn binary search and here it is !

ShivamSingh-vuvq
Автор

9:20 in this we could write index instead of -1 in the else statement in cout

agx
Автор

Undoubtedly the best video tutorial on the topic ❤️❤️❤️ Good job @Striver

evergreen
Автор

Awesome explanation bro...
Please try to make more videos on STL..

Thank you

nagavijaykumarprathi
Автор

How someone can explain with this ease....thanks bhaiya

lyricalfade
Автор

Wonderful demonstration of stl binary search

rohitsai
Автор

No kidding, You really explain very well . Thank you for all these videos . Really very helpful!!!!

HarshitSingh-itkp
Автор

I was confusing lower bound with floor value. thank you so much!

Mrswapsam
Автор

thank you srila prabhupad, krishna and sir

freeandreliablejeeprep
Автор

the upper bound condition check should be like this. you missed the -1 from index.
if( ind >= 0 && [ ind - 1 ] ==x)cout<<j<<endl;

fahimtoufiqulislam
Автор

Thank you very much. You are a genius. 👍👍👌👌🙏🙏🔝🔝

vakhariyajay
Автор

Amazing the problem set as well as explanation

chinturadix
Автор

Please upload more dynamic programming videos

Firstusee
Автор

Should the array be previously sorted to perform lower and upper bound

ShivamSingh-vuvq
Автор

thank u so much for this wonderful video

smoothierudiee
Автор

You literally speak like the girl in the American Pie who kept saying:
"Aah, .... that one time, ..at Band Camp"😂😅.

But you really are a solid teacher.. loved the video.

shishankrawat