refine (K3v123 comment)
This commit is contained in:
parent
bf4f396b2c
commit
ea44ca424e
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
**Q**: Why does a hash table contain both linear and non-linear data structures?
|
**Q**: Why does a hash table contain both linear and non-linear data structures?
|
||||||
|
|
||||||
The underlying structure of a hash table is an array. To resolve hash collisions, we may use "chaining" (discussed in a later section, "Hash collision"): each bucket in the array points to a linked list, and it might be transformed into a tree (usually a red-black tree) when its length is larger than a certain threshold.
|
The underlying structure of a hash table is an array. To resolve hash collisions, we may use "chaining" (discussed in a later section, "Hash collision"): each bucket in the array points to a linked list, which may transform into a tree (usually a red-black tree) when its length is larger than a certain threshold.
|
||||||
From a storage perspective, the underlying structure of a hash table is an array, where each bucket might contain a value, a linked list, or a tree. Therefore, hash tables may contain both linear data structures (arrays, linked lists) and non-linear data structures (trees).
|
From a storage perspective, the underlying structure of a hash table is an array, where each bucket might contain a value, a linked list, or a tree. Therefore, hash tables may contain both linear data structures (arrays, linked lists) and non-linear data structures (trees).
|
||||||
|
|
||||||
**Q**: Is the length of the `char` type 1 byte?
|
**Q**: Is the length of the `char` type 1 byte?
|
||||||
|
Loading…
Reference in New Issue
Block a user