How to determine if a sequence is bitonic?

后端 未结 5 1128
遥遥无期
遥遥无期 2020-12-23 18:00

A sequence is bitonic if it monotonically increases and then monotonically de- creases, or if it can be circularly shifted to monotonically increase and

5条回答
  •  清酒与你
    2020-12-23 18:07

    There need to be exactly two (or, depending on how your definition deals with degeneracy, exactly 0) transitions between rising and falling. Don't forget to check the transition between a[n] and a[0].

提交回复
热议问题