deque c 2b 2b

Solutions on MaxInterview for deque c 2b 2b by the best coders in the world

showing results for - "deque c 2b 2b"
Hortense
08 Mar 2018
1/*  A deque is a dynamic array whose size can be efficiently 
2changed at both ends of the array. Like a vector, a deque provides
3the functions push_back and pop_back, but it also includes the 
4functions push_front and pop_front. */
5deque<int> d;
6d.push_back(5); // [5]
7d.push_back(2); // [5,2]
8d.push_front(3); // [3,5,2]
9d.pop_back(); // [3,5]
10d.pop_front(); // [5]