Practices
  Home arrow Practices arrow Basic Array Searching in C++
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PRACTICES

Basic Array Searching in C++
By: Bryan Roth
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 29
    2004-12-27

    Table of Contents:
  • Basic Array Searching in C++
  • Sequential Search
  • Binary Search
  • Coding a Binary Search

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Basic Array Searching in C++
    (Page 1 of 4 )

    Searching arrays for a particular value is a common activity that any programmer should know how to do. Bryan Roth discusses two basic searching methods, sequential and binary, and shows how to code them in C++.

    Searching is a very useful operation within the C++ language and any other programming language. Searching is especially useful with arrays. Searching is used daily on the Internet, with surfers using search engines like Google.

    Performance is a must with search engines. There are also many ways you can take advantage of searching, like trying to locate a certain transaction number within a large database, finding a certain item located in an inventory database, implementing searching methods within a library catalog, and the list can go on and on. 

    Within this article two basic searching methods will be introduced and discussed. These two methods are the sequential search and the binary search. Each searching method has its pros and cons, which will be listed after each explanation.

    It is essential to know these two types of searching and how they perform before moving on to more advanced searching methods. With each searching method walkthrough there will be an example followed by an implementation of the example to give you a better understanding of how each searching method works.

    More Practices Articles
    More By Bryan Roth


       · A good refresher on basic array searching, but there are some flaws. Can you fix...
       · Hey Anonymous Loozah,1. I realized that the table examples where the same over...
       · Thanks. I'm looking forward to your next article.
       · on the one hand this is a useful article, on the other, anyone who doesn't know how...
       · Thanks for the quick editing.
     

       

    PRACTICES ARTICLES

    - Basic Data Types and Calculations
    - What`s the Address? Pointers
    - Design with ArgoUML
    - Pragmatic Guidelines: Diagrams That Work
    - Five-Step UML: OOAD for Short Attention Span...
    - Five-Step UML: OOAD for Short Attention Span...
    - Introducing UML: Object-Oriented Analysis an...
    - Class and Object Diagrams
    - Class Relationships
    - Classes
    - Basic Ideas
    - Choosing the Right Team
    - Trees
    - Basic Array Searching in C++
    - Solving Problems with Recursion




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway