Intuitively Choose the Right Data Structure

An important thing to note is that in an interview when you are solving a problem, you almost always choose a data structure for its strength. In other words, you don’t usually choose a data structure just because it has fewer weaknesses and has a good average-case performance. For example, if you want to find a maximum number frequently, priority queue/heap is most likely the best choice. If you want to store some value associated with a key, a hashmap is likely the best choice. … More Intuitively Choose the Right Data Structure