471,873 Members | 1,710 Online

# data stucture using c

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

Aug 26 '06 #1
7 4573
"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

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
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
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

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
"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
--
"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
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

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
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
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.