看板 ACMCLUB 關於我們 聯絡資訊
※ 引述《pangfeng (Ikari Gendou)》之銘言: : ※ 引述《CorruptAngel (微笑面具)》之銘言: : : pe DVD problem(也許是greedy 不確定) (a.k.a paging problem) : : There r k DVD readers, more than k DVDs, and a request list. : : To minimize the value of insertion. : OS 的恐龍書有提到greedy就是optimal. : 作法我記得是將現存page中'最後才會被使用'的移除. : 很多隊都知道要這樣作,但都WA. : 我剛才想到,是不是沒考慮到'以後都不出現'的page? : 這種page事實上要先移除,因為它也算'最後才會被使用'. I create a 1-D array to record when is the next time the DVD will be requested,and if it won't appear again,give it a value 110 (because the max length is 100),and got WA....><.. We though that greedy was an incorrect algorithm,so didn't debug....... (chinese typing crashed...XD) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.82