333
 правки
Изменения
→Псевдокод
== Псевдокод ==
<code>
     x = 1
     '''while''' f(x) < cvalueOffFunc
         x = x * 2
     '''return''' x
</code>
<code>
     x = -1
     '''while''' f(x) > c valueOffFunc 
         x = x * 2
     '''return''' x 
</code>
<code>
 '''double''' binSearch(valueOffFunc : '''double''' c):     left = '''findLeft'''findLeftBoard(сvalueOffFunc)     right = '''findRight'''findRightBoard(сvalueOffFunc)
     '''while''' left < right - eps                           <font color=green> //Здесь можно использовать другое условие выхода </font>
         mid = (left + right) / 2
         '''if''' f(mid) == c                                 valueOffFunc                      <font color=green> //** </font>
             '''return''' mid                                 <font color=green> //** </font>
         '''else if''' f(mid) < cvalueOffFunc
             left = mid
         '''else'''
