תפתח את בראסארד בייבי...
מבחינה תיאורתית זמן הכנסה ושליפה מhashtable הוא זמן קבוע O של 1 - בפועל מדובר בזמן הכנסה והוצאה, בלי תלות בזמן hash function, אבל גם היא יכולה להיות בזמן קבוע.
פונקציית hash היא פונקציה חד כיוונית וחד חד ערכית (חד חד ערכיות לא תמיד - במציאות)
לגבי חד כיוונית... אני מפציר בך לבצע MD5 לסטרינג ולנסות לקבל את הסטרינג בחזרה...או SHA1...ספר לי איך היה...
לגבי החלק האחרון שלא נכון בכלל - אני מתקשר לבראסארד להגיד לו שאתה טוען שהוא טועה?
Hash collisions are practically unavoidable when hashing a random subset of a large set of possible keys. For example, if 2,500 keys are hashed into a million buckets, even with a perfectly uniform random distribution, according to the birthday problem there is a 95% chance of at least two of the keys being hashed to the same slot.
Therefore, most hash table implementations have some collision resolution strategy to handle such events. Some common strategies are described below. All these methods require that the keys (or pointers to them) be stored in the table, together with the associated values.
מה גם איך תסביר את הסיבה שבג'אווה כשאתה פותח HashTable אתה רואה שמדובר ברשימה מקושרת? וזה העתקה מה
Documentation של Java7
Note that the hash table is open: in the case of a "hash collision", a single bucket stores multiple entries, which must be searched sequentially.
לגבי המימוש בפייטון, אתה צודק - זה לא ככה - זה מטפל בcollision באמצעות הזזה לתא הבא לשיטה קוראים probing.
סתם להעשרה עצמית תיכנס
http://en.wikipedia.org/wiki/Hash_function
http://en.wikipedia.org/wiki/Hash_table
חבל סתם להתנגח בי כל הזמן טרולוש - לפחות תבדוק שאתה צודק.