@@ -25,9 +25,10 @@ method simply stores all elements having the same hash in a linked list. When a
25
25
hash and then go through the linked list of "possible" values until it finds the matching entry. Here is an
26
26
illustration of chaining collision resolution:
27
27
28
- .. image :: ./images/basic_hashtable.svg
28
+ .. image :: ./images/basic_hashtable.*
29
29
:align: center
30
30
:height: 265px
31
+ :scale: 200%
31
32
32
33
The elements of the linked list are called ``Bucket ``\s and the C array containing the heads of the linked lists is
33
34
called ``arBuckets ``.
@@ -38,9 +39,10 @@ bucket of ``"a"`` which you can do either by traversing the linked list for the
38
39
pointers in the reverse direction. The latter is what PHP does: Every bucket contains both a pointer to the next bucket
39
40
(``pNext ``) and the previous bucket (``pLast ``). This is illustrated in the following graphic:
40
41
41
- .. image :: ./images/doubly_linked_hashtable.svg
42
+ .. image :: ./images/doubly_linked_hashtable.*
42
43
:align: center
43
44
:height: 250px
45
+ :scale: 200%
44
46
45
47
Furthermore PHP hashtables are *ordered *: If you traverse an array you'll get the elements in same order in which you
46
48
inserted them. To support this the buckets have to be part of another linked list which specifies the order. This is
@@ -49,9 +51,10 @@ The forward pointers are stored in ``pListNext``, the backward pointers in ``pLi
49
51
structure has a pointer to the start of the list (``pListHead ``) and the end of the list (``pListLast ``). Here is an
50
52
example of how this linked list could look like for the elements ``"a" ``, ``"b" ``, ``"c" `` (in that order):
51
53
52
- .. image :: ./images/ordered_hashtable.svg
54
+ .. image :: ./images/ordered_hashtable.*
53
55
:align: center
54
56
:height: 250px
57
+ :scale: 200%
55
58
56
59
The HashTable and Bucket structures
57
60
-----------------------------------
0 commit comments