看板 Prob_Solve 關於我們 聯絡資訊
大家好 如果我想從一萬筆資料 刪除 相同的資料 形態是string 除了每個檢查 在塞入 陣列外 還有什麼演算法可以用嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.0.213
johnlinvc:cat data | uniq > result 01/21 16:11
※ 編輯: keke0421 來自: 140.113.0.213 (01/21 16:36)
suhorng:用個hash table存 相同的可以被篩掉 01/21 17:52
suhorng:真的要穩定線性的就用 trie 01/21 17:53
suhorng:說 hash table 是因為有內建 unordered_set 01/21 17:53
c2251393:推trie 不然如果string長度小的話直接用balanced tree(? 01/21 21:24