You are on page 1of 4

Date

Page

Assignment no- 3

o0Explain lineay and Binamyseorch its Time Com ole!


ond compare ime and space compleity
- ngarSearch also Enown as sequenbal Seavch is
Simple algoihm to Fnd specifcelement wti,
a collechon DE data,Such as an
amay OY a list

-Lo a lineax Seavchyou tart at the begnning


Of tte collechon and compart each element one by
with the elemen t to be Searche d [KeyJunbll
gousnd a nateh.

Aduantagsi0simpliuby
No eqimment For Sortd
Q Memory eeficienty
Disadvanoges - Taefiueny for lage dato sets
CaSe Senano

Time
haycomplesily
seavch
olgoHthm USed
a
hgaly
a
effcient
Specifc
Searchng
element in
Sorte d collechon of dota Svch as an
aray OY list

Advontoges Oivde and Conguet


O minmad compaision count
dassmate
Date
Poge

Ds advontoaqes Sorted Data


Dstoic dato
Laek Of £lexibiliy
Timecomplexiy dlogn)
ineay lsecrch i Ginary Search
TiDe the cwoYS case,it I t has te Gme compleziy
(ompib hasthe bme complexd
iby
5pace IL has low spoie TE can haue as ocD
ampilycamplexiby Qs it opralts it inplementd ieraing
direcHy an theexishng 0sit does not quie
dota sbvc addihono O:S

algonhm for fboraci GeovchGnd its


Time complexig
This Seaxch techniqve i s based On fbo nacci
Senes

2 3 5 3 2 ) this Seies is formed


by ading the staving noand con bnue

adding
Date
( Page

effiient Seachmehod ybased on


divide and Conquev

Time complesity
Algonthm -
sepli find fC*) wbich is qealey than or
isqreakey
equa to 'n?

Step. 2 :- it eck) 0, thein slop and pint. element


hot found

stzpiiamin Lofsett Fck)n

j and stop

peat
Jf S LAC K=k-2
epe at sep
classste
Dete
Poge

Dot Sta bility of snbng


Compo Bubble, LnSertotion and selechon Sort
andits Time
complexiy
Soring methbd is Soid to be
Stableie idenbcad
elemens OcCUYSin Same nlahe ordey

O Bubble Soxt :
it has CaSe
and auag
Case bime complexity oe oCa)
bstab:ili yi- 1t is a stable
soxing algoi thm
is adapbue hich Mean S It
perform bettey parbally Sonted list
aTosexhon Soyt

CaSP
and aueroqe Case
Gme compleiby oE oCA^2)
b
stabi liy also Stable algontm
On Dlarly Sorttd list.
selechon Soxt:

a £ffuecy i- woY[t and avprage (ase is ola i)

bStobi liy hot stable

You might also like