Search (binary/ternary) in a step function

Revision en1, by arjunsanjeev7, 2016-07-12 13:17:13

I have a step function 'V', over a domain 't' in [0,10^7]. It has shape as shown below.

V(t) = 0 for t in [0,a),
...... = 1 for t in (a,b), and
...... = 0 for t in (b,10^7]
for some 0 <= a < b <= 10^7.

What is the best way to find a and b (i.e., the starting and ending points of V(t)=1)? Can binary/ternary search be applied in this case?

Tags step function, search, binary seach, ternary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English arjunsanjeev7 2016-07-12 13:17:13 495 Initial revision (published)