C++ 디큐

1 개요[ | ]

C++ deque
C++ 디큐
#include <iostream>
#include <deque>
using namespace std;

void showq(deque<int> q) {
    deque<int> qq = q;
    while (!qq.empty()) {
        cout << qq.front() << ' ';
        qq.pop_front();
    }
    cout << '\n';
}

int main() {
    deque<int> q;
    q.push_back(1);
    q.push_back(4);
    q.push_back(8);
    q.push_front(3);
    
    showq(q); // 3 1 4 8
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}