Summary

In this chapter, we have successfully built others linear data types: the Stack, Queue, and Deque data types. We can use the Stack data type if we need storage that only has one side to insert and remove an element, we can use the Queue data type if we need storage which has to insert and remove the element from a different side, and if we need storage that can be accessed from two sides, both the front and back sides, we can use the Deque data type. Fortunately, the time complexity for all of the operations in these three data types is O(1), and doesn't depend on the number of the elements in the data type. In the next chapter, we are going to discuss various sorting algorithms to arrange the elements inside the data types we have ...

Get C++ Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.