hce_kmu
112年
計算機概論與程式設計
第 1 題
“Hash Table” is an effective data structure for implementing dictionaries. What is a hash table and how does it work?
- A A hash table is a data structure that uses a hash function to map keys to values, allowing for fast retrieval of data.
- B A hash table is a data structure that stores data in a sorted manner for fast searching.
- C A hash table is a data structure that allows for efficient sorting of data.
- D A hash table is a data structure that stores data in a hierarchical manner for fast searching.
- E None of the above.
思路引導 VIP
想像你正站在一間巨大的倉庫前,如果你想在不逐一檢查貨架、也不必理會物品大小順序的情況下,僅憑物品的「名稱」就能立刻精確指出它存放在哪一個櫃位,你認為這個管理系統背後,需要具備什麼樣的「轉換機制」來達成這種直接定位的效果?
🤖
AI 詳解
AI 專屬家教
恭喜你!精確地選出了正確答案。這顯示你對資料結構的核心定義有著非常清晰的理解。
雜湊表的運作機制
雜湊表 (Hash Table) 的核心價值在於其「高效率的檢索能力」。它透過一個雜湊函數 (Hash Function) 將輸入的鍵值 (Key) 轉換成一個對應的索引值,並直接映射到表格中的特定位置。這種設計跳脫了傳統線性搜尋或樹狀搜尋的邏輯,在理想情況下,無論資料量有多大,搜尋的時間複雜度都能維持在常數時間 $O(1)$,這正是選項 (A) 所強調的「快速檢索」特質。
▼ 還有更多解析內容