JavaScript
  Home arrow JavaScript arrow Binary Searching
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 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? 
JAVASCRIPT

Binary Searching
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-06-30

    Table of Contents:
  • Binary Searching
  • Tutorial Approach
  • Demonstration of Binary Search
  • Demonstration continued
  • Algorithm for 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


    Binary Searching


    (Page 1 of 5 )

    Binary Searching involves searching for an element in an array, where the items are arranged in ascending or descending order. That means the entries in the array are sorted. If you want to learn how to write a function that does this, keep reading.

    Introduction

    At the moment, I am writing a series of articles concerning database programming for www.devhardware.com. Some recordset APIs are supplied with a Find function; you just use the Find function without knowing how it was written. Other APIs may not have any Find function; this means that you have to write the Find function yourself (when you need one).

    Therefore, if you are a database programmer, knowing how to write an efficient Find function is a big plus. In this article, I show you how to write the binarySearch function, which is very efficient for traditional (client side) database programming.

    There are other reasons why you would want to understand Find functions, in particular the binarySearch function. Maybe you want to write a database programming API. Maybe you did not understand the topic well at your university (or associate degree program). Maybe they did not even cover it at your university. Maybe you are a self-trained programmer and you want to learn more. Maybe you are a teacher or lecturer and you want to get a better understanding of the topic in order to teach it well. Maybe you want to write a Find function for an array of strings, which is not concerned with a database.

    Well, I will show you how to write the BinarySearch function, since it is the type relevant to the series I am writing. I will use JavaScript. You need a browser and text editor to try the code.

    More JavaScript Articles
    More By Chrysanthus Forcha


       · Binary Searching produces very fast result whenever you have an array that is...
     

    JAVASCRIPT ARTICLES

    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT