Ternary Search


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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, 08:50 AM
  2. advance search
    By saquib189 in forum ASP.NET
    Replies: 0
    Last Post: 08-19-2008, 07:28 AM
  3. Replies: 2
    Last Post: 02-07-2008, 12:37 AM
  4. Replies: 0
    Last Post: 10-11-2006, 05:10 PM
  5. Replies: 6
    Last Post: 07-08-2006, 11:48 PM

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center