-
C++❤️deque 예제 코드코딩Coding/알고리즘♡Algorithm♡ 2022. 9. 20. 22:48728x90
https://en.cppreference.com/w/cpp/container/deque
std::deque - cppreference.com
template< class T, class Allocator = std::allocator > class deque; (1) (2) (since C++17) std::deque (double-ended queue) is an indexed sequence container that allows fast insertion and deletion at both its beginning and its end. In addition, in
en.cppreference.com
#include <iostream> #include <deque> int main() { // Create a deque containing integers std::deque<int> d = {7, 5, 16, 8}; // Add an integer to the beginning and end of the deque d.push_front(13); d.push_back(25); // Iterate and print values of deque for(int n : d) { std::cout << n << ' '; } }
반응형'코딩Coding > 알고리즘♡Algorithm♡' 카테고리의 다른 글
Lec 1 | MIT 6.046J / 18.410J Introduction to Algorithms (SMA 5503), Fall 2005 | MIT OpenCourseWare (0) 2022.10.13 Lecture 1: Algorithmic Thinking, Peak Finding | MIT OpenCourseWare (0) 2022.10.08 C언어❤️Circular-linked-list _ (2) 2022.09.20 Algorithm and Data Structures __ C❤️ (2) 2022.09.20 Data Structure❤️Queues in C 큐 구현하기C언어 코드 (0) 2022.09.19 C++❤️Container classes (0) 2022.09.18 Queue Program In C (0) 2022.09.18 C언어- 스택Stack(C언어 코드로 구현하기)macOS (0) 2022.09.12