-
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?
-
Similar Threads
-
By jabbarsb in forum ASP.NET
Replies: 1
Last Post: 08-20-2008, 07:50 AM
-
By saquib189 in forum ASP.NET
Replies: 0
Last Post: 08-19-2008, 06:28 AM
-
By Khushwinder in forum Java
Replies: 2
Last Post: 02-06-2008, 11:37 PM
-
Replies: 0
Last Post: 10-11-2006, 04:10 PM
-
By Urbaud in forum VB Classic
Replies: 6
Last Post: 07-08-2006, 10: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
Forum Rules
|
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
|
Bookmarks