DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Ternary Search

  1. #1
    Join Date
    Mar 2009
    Posts
    24

    Ternary Search

    I know how to implement binary search using recursion where you divide the array into 2 parts and recursively search each part for a certain number. Now how do I do this by dividing the array into 3 parts?

    For example, if I have an array a[] of some length, and p (0) and q (length of array - 1). What are the lower and upper bounds of each of the three parts?

    What would I use as the base case?

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468

Similar Threads

  1. Customized Google Search Box
    By jabbarsb in forum ASP.NET
    Replies: 1
    Last Post: 08-20-2008, 07:50 AM
  2. advance search
    By saquib189 in forum ASP.NET
    Replies: 0
    Last Post: 08-19-2008, 06:28 AM
  3. Replies: 2
    Last Post: 02-06-2008, 11:37 PM
  4. Replies: 0
    Last Post: 10-11-2006, 04:10 PM
  5. Replies: 6
    Last Post: 07-08-2006, 10:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links