473,841 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
thanks in advance

Aug 26 '06 #1
7 4664
"enrique" <ak********@gma il.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*jab ber.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
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
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
"enrique" <ak********@gma il.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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
969
by: Alex | last post by:
Hi I am trying to find out what the best way to structure a .net application is. In the past using VB I would call a Sub Main procedure and setup a controller class which kind of held a reference to all the other classes. I would then create a main form (from sub main) which could access and class through the controller class which was stored in a module. This format worked quite nicely because it made it easy to seperate most of the code...
0
949
by: Johan Smidje | last post by:
Hi. I have a problem with validating XML files with XSD. For now I can only validate the stucture of the XML document but I would also be able to validate the data. The problem is that the valid data (and dataranges) is dynamic and I have to retrieve them from the database. Is it possible to create restrictions refering to other .NET conponents?
5
2056
by: PengYu.UT | last post by:
Hi, I'm searching for an implementation of set. I want to insert or delete elements. The set should have no redudant element. It seems linked list is one way for implementing set. But I don't have any experence how to handle the C++ concept "templete" in C. That is how to make the implemetation adaptable to different data types.
0
1034
by: Junky | last post by:
Hi folks, I guess I need a little help on this one. I'm developing a web application using the TreeView object from the WebControls (System.Web.UI.WebControls). Hierarchical data are read from the database through a stored procedure. They have the following stucture: Name id level AE 500100 3
55
3171
by: Robotnik | last post by:
Hello All, I want to know if we could know the size of a structyure without the use of sizeof(). Any hints.
3
1983
by: PB | last post by:
Hi, Can anyone please help me with SQL syntax to create a second variable based on the value of another (both numeric)? My effort is below but I get a syntax error. SELECT charA,
6
1860
by: bill | last post by:
All, I have an unmanaged data structure that I use to pass to an umanaged DLL written in C. This works great. The structure looks sort of like this: unsafe public struct Inputs { .....
0
914
by: LokanathaReddy | last post by:
Hi, Application type : ASP.NET 2005 Input : MSWord 2000,xp,2003... SRS(requirements docs) Task: : read data(requirements) and update in database Tool has to read all the headings and tables, update all the fields in database for each requirement. some times all requirements will be in same table, set of tables, individual table for each req or other format. User has to define his own ...
7
5685
by: PaowZ | last post by:
Hi there! I'm facing an issue concerning tree data structure in php. In others languages, I just need to create a root node which I bind pointers of instances representing others nodes. But I couldn't find a way to do so in php language. Indeed, object instances are "volatile" reaching the end of the script. How could I build a tree with "volatile" address pointers in php ? I could use arrays to store data like a tree structure but I'd...
0
9703
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10302
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7846
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7024
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.