15. When to Use What
In This Chapter
In this chapter we briefly summarize what we’ve learned so far, with an eye toward deciding what data structure or algorithm to use in a particular situation.
This chapter comes with the usual caveats. Of necessity, it’s very general. Every real-world situation is unique, so what we say here may not be the right answer to your problem. This chapter is divided into these somewhat arbitrary sections:
• General-purpose data structures: arrays, linked lists, trees, hash tables
• Specialized data structures: stacks, queues, priority queues, graphs
• Sorting: insertion sort, Shellsort, quicksort, mergesort, ...