Baiterr's blog

By Baiterr, history, 13 months ago, In English

help pls

  • Vote: I like it
  • -8
  • Vote: I do not like it

| Write comment?
»
13 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

Ternary search helps in such scenarios where the function is first increasing and then decreasing or first decreasing and then increasing

»
13 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

at linear functions the array is increase or decrease we use binary search but at quadratic function it decrease then increase or increase then decrease we use tirnary search u could see the visualization of a function at geogebra for example

»
13 months ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

You don't binary search. Instead, you use ternary search

»
13 months ago, hide # |
 
Vote: I like it +36 Vote: I do not like it

you can do binary search not on the initial array (for example $$$arr$$$), but on $$$arr_i - arr_{i+1}$$$. Firstly sign of this function will be negative, then positive, so you can use binary search

»
13 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

use binary search and Sparse Table