This would be a very important question which has
a very very high probability of being asked well
binary search as the name suggests Uh it 's two
entities
The first thing you have to always remember when
you work with binary search is that it 'll only work on
sorted data well. Your data either has to be sorted in
the ascending order or the descending order
compulsorily, and once you have the ordered data
basically, you have an array. Let 's say you have an
array and basically. If you have to search an element
in this particular array. The first thing you'll do is you
will find the middle element of it. If it 's an even
number. Your middle number will be considered as
the average of those two numbers, but then if you
have an odd number, you will find one singular middle
element. So then the data is basically split into the left
side and the right side. Now. If you arranged it in in
the ascending order, UH let 's say we. Have top seven
elements one two. Three four five six. Seven four will
be the middle element right so if you 're searching for
three. Then of course you already know that you do
n't have to search up and above four. Because it wo n't
be there. Your data is already in the ascending order,
so you'll of course search below four. Then again you
will split it into one two. Three four. Where uh one
, and two can be put into one side three and four can be
put into the other side and search. So this goes on in
an iterative order
The top 50 data structure interview
questions that you can use to ace all
of the interviews and to help you land
your dream job. This is a compilation
of questions which have the highest
amount of probability to be asked in
any data structures interview. Data
structures are methods and
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller sanathsrinivasud75. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £8.56. You're not tied to anything after your purchase.