is a “non-decreasing” sequence “increasing”?

后端 未结 8 694
梦如初夏
梦如初夏 2020-12-23 16:27

While studying the book \"Introduction to Algorithms by Cormen\", I found a strange thing. Everywhere if it refers to an increasing order, the book refers it as \"non-decrea

8条回答
  •  [愿得一人]
    2020-12-23 16:48

    It depends on the way the author defines these terms.

    In your case the authors distinguish non-decreasing (1, 2, 2, 3) and increasing (1, 2, 3). This makes sense in the context of a total order, where not a > b implies a <= b.

    Other people call this increasing (1, 2, 2, 3) and strictly increasing (1, 2, 3). This makes more sense in the context of a partial order, where for two distinct elements a and b it may be the case that neither a < b nor b < a holds.

提交回复
热议问题