Different ways to insert elements in Deque in C++

We will discuss the insert methods of a badass data structure, i.e. deque, which contains the goodness of both, the good old stack and queue. In it we can access both the front and back thus breaking the LIFO and FIFO barriers. There are also ways to add elements directly in one of the interior positions, though it takes away the saliva inducing constant time complexity, giving us the worse yet not really linear time one. The insert methods discussed here are:

deque::push_back() and deque::push...
 •  0 comments  •  flag
Share on Twitter
Published on May 19, 2021 14:54
No comments have been added yet.