What are some advantages of linear probing over separate chaining?


#1

Question

In the context of this exercise, what are some advantages of using linear probing over separate chaining?

Answer

When using linear probing, one advantage is that it can use less memory than separate chaining. When using separate chaining, each index of the hash map stores another data structure, which can require a lot more memory than linear probing does, which only needs a single list data structure

In addition, another advantage as a result of the single data structure is that it can perform faster than separate chaining. This is because the memory addresses used for the single list are closer together, while separate chaining can have each data structure in different locations far apart from each other.

One other advantage can be the ease of access and use of the data. Using linear probing, all values are in one place in the single list, and we can quickly access and take a look at our values.