Why are all these data structures necessary? Strictly speaking, they aren’t.Most
things you want to do with a computer can be done with arrays alone. However,
arrays have drawbacks: unsorted arrays are slow to search, and sorted arrays are
slow at insertion. By contrast, hash tables and trees are fast for both search and
insertion. These structures are more complicated than arrays, but the speed difference
is compelling.