any1 no how we can improve a ternary search algorithm?
ternary(V, s, e)
if s > e
return -1
else
m1 ← (e-s)/3 + s
m2 ← 2*(e-s)/3 + s
if V = A[ m1 ]
return m1
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
Search:Type: Posts; User: wildheart25c Search: Search took 0.01 seconds.
Results 1 to 4 of 4
|
Click Here to Expand Forum to Full Width |