By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,686 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,686 IT Pros & Developers. It's quick & easy.

data stucture using c

P: n/a
i m in touch with c from last 1yr now just started data stucture in c
and i have a problem
in linear search and binary search if any one could explain with one
example each
thanks in advance

Aug 26 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"enrique" <ak********@gmail.comwrites:
in linear search and binary search if any one could explain with one
example each
http://en.wikipedia.org/wiki/Linear_search
http://en.wikipedia.org/wiki/Binary_search

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
Aug 26 '06 #2

P: n/a

enrique wrote:
i m in touch with c from last 1yr now just started data stucture in c
and i have a problem
in linear search and binary search if any one could explain with one
example each
thanks in advance
I believe this is OT for this forum, but heres an example anyway:

a list of unsorted numbers:

8 4 9 5 7 6 1 2 3

We want to search for 7. Linear search, start at beginning and go
through each number until you hit 5. i.e. 8->4->9->5->7 done.

Binary search, sort first.

1 2 3 4 5 6 7 8 9

Look at middle point: 5, this is less than 7 so it can't be in the
bottom half so chop it out and you're left with

6 7 8 9

Look at middle point (say 8 for now) this is greater than 7 so can't be
in top half. Left with
6 7

Look at middle point (7) done.

Aug 26 '06 #3

P: n/a
enrique posted:
i m in touch with c from last 1yr now just started data stucture in c
and i have a problem
in linear search and binary search if any one could explain with one
example each
thanks in advance

http://en.wikipedia.org/wiki/English_spelling
http://en.wikipedia.org/wiki/English_grammar
http://en.wikipedia.org/wiki/Punctuation

--

Frederick Gotham
Aug 26 '06 #4

P: n/a
"enrique" <ak********@gmail.comwrites:
i m in touch with c from last 1yr now just started data
stucture in c and i have a problem in linear search and binary
search if any one could explain with one example each
http://adtinfo.org/libavl.html/Search-Algorithms.html
--
"The lusers I know are so clueless, that if they were dipped in clue
musk and dropped in the middle of pack of horny clues, on clue prom
night during clue happy hour, they still couldn't get a clue."
--Michael Girdwood, in the monastery
Aug 26 '06 #5

P: n/a
Frederick Botham wrote:
enrique posted:

>>i m in touch with c from last 1yr now just started data stucture in c
and i have a problem
in linear search and binary search if any one could explain with one
example each
thanks in advance

http://en.wikipedia.org/wiki/English_spelling
http://en.wikipedia.org/wiki/English_grammar
http://en.wikipedia.org/wiki/Punctuation
Inappropriately harsh.

This isn't some one posing in gobbledygook speak, it is some one doing
their best in a second language.

--
Ian Collins.
Aug 26 '06 #6

P: n/a
Ian Collins posted:
>http://en.wikipedia.org/wiki/English_spelling
http://en.wikipedia.org/wiki/English_grammar
http://en.wikipedia.org/wiki/Punctuation
Inappropriately harsh.

This isn't some one posting in gobbledygook speak, it is some one doing
their best in a second language.

If anything, I thought it might get across to the OP that maybe they should
try improve the quality of their writing.

(English not being the OP's mother tongue doesn't quite explain the lack of
punctuation -- unless their mother tongue is written in a different script I
suppose.)

--

Frederick Gotham
Aug 27 '06 #7

P: n/a
http://en.wikipedia.org/wiki/English_spelling
http://en.wikipedia.org/wiki/English_grammar
http://en.wikipedia.org/wiki/Punctuation
Inappropriately harsh.

This isn't some one posing in gobbledygook speak, it is some one doing
their best in a second language.

--
Ian Collins.
Quite agree.

Sep 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.