directory
- Hash table (object)
- The list
- An array of
- Other data structures
1, Hash table (object)
A hash table is an object in JS
Features:
- A disorderly
- Array + linked list = hash
Hash collision (a normal phenomenon)
The solution
- capacity
- Let’s do linked lists
Second, the linked list
The biggest feature is that the add/delete time is O (1).
For example, if you’re in a line, you don’t need to know what number you’re in, you just need to know who’s next.
Time complexity of the operation
1) Circular list
Three, arrays,
Time complexity of the operation
In addition to searching through indexes, other searching apis (such as includes and splice) have O(n) time complexity.
Other data structures
All data structures are composed of arrays and hashes.