Order theory¶
Dilwoths's theorem: Suppose that the length of the longest antichain in the poset P is r, then P can be partitioned into r chains.
Dilworth's dual theorem: Suppose that the length of the longest chain in the poset P is r , then P can be partitioned into r antichains.
Erdős-Szekeres theorem: Given n ≥ rs + 1 , any sequence of n elements has either an increasing subsequence of length r+1 or a decreasing subsequence of lengthe s+1.
推薦這個影片講解非常清楚:
其他相關資料:
遍歷逆序位置¶
在一堆上升區間中,快速的遍歷逆序的位置的優化方式。
用一個陣列儲存下次逆序位置。
- \(\text{nxt\_dec} [i]\) 指向當前上升區間的尾端。