class Interval {
    int start;
    int end;
    // int height;
    Interval (int start, int end) {
        this.start = start;
        this.end = end;
    }
}

其基本思想就是在众多可能的情况中,只考虑我需要用的值.

而且对于每个值的意义要明确定义。

离散方法:

  1. separate segments, points.

  2. most naive way: make each possible point a separate point.

  3. optimize: only care about boundary points.

  4. advanced data structure \/ algorithm.

results matching ""

    No results matching ""