窮舉法:max-points-on-a-line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 析:此處的在一條直線上也包含斜的直線,所以分爲水平豎直線、斜線兩種狀況。 若是是水平豎直線,直接以橫座標或縱座標爲參考做統計便可; 若是是斜線,得先把斜線定義成Line類,包含k b兩個值, 以後分別
相關文章
相關標籤/搜索