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
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper sanathsrinivasud75. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €9,67. Je zit daarna nergens aan vast.