in reply to Re^4: elsif chain vs. dispatch
in thread elsif chain vs. dispatch
The degenerate case has nothing to do with the ratio of used buckets to the number of total buckets.
The degenerate case occurs when the number of elements in the hash (0+keys(%hash)) is much greater than the number of buckets in use (0+%hash) because most of keys hash to the same value.
Locating a key in the degenerate case is a linear search since they're all in the same bucket.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: elsif chain vs. dispatch
by Marshall (Canon) on Apr 27, 2009 at 21:02 UTC | |
by ikegami (Patriarch) on Apr 27, 2009 at 21:16 UTC | |
by JavaFan (Canon) on Apr 27, 2009 at 22:40 UTC | |
by Marshall (Canon) on Apr 27, 2009 at 23:30 UTC | |
by ikegami (Patriarch) on Apr 27, 2009 at 23:36 UTC | |
by Marshall (Canon) on Apr 28, 2009 at 00:02 UTC | |
| |
by JavaFan (Canon) on Apr 28, 2009 at 00:14 UTC | |
by Marshall (Canon) on Apr 28, 2009 at 04:49 UTC | |
|
Re^6: elsif chain vs. dispatch
by Marshall (Canon) on Apr 27, 2009 at 21:54 UTC |