[問題] LFU實作問題
開發平台(Platform): (Ex: Win10, Linux, ...)
linux
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
g++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
bits/stdc++.h
問題(Question):
學校作業實作LFU
我是用set維護reference count最小值的資料結構
Hash 儲存reference count
餵入的資料(Input):
較長不知道怎麼提供
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
一千萬筆資料多了二十萬筆miss
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
https://ideone.com/GejpWw
補充說明(Supplement):
有用double hash維護最小reference做是正確的
但是不太清楚為什麼用set的結果會有錯誤
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.231.50 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1637743882.A.61B.html
推
11/24 18:24,
3年前
, 1F
11/24 18:24, 1F
→
11/24 18:24,
3年前
, 2F
11/24 18:24, 2F
→
11/24 20:47,
3年前
, 3F
11/24 20:47, 3F
→
11/24 20:48,
3年前
, 4F
11/24 20:48, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章