Search
 
SCRIPT & CODE EXAMPLE
 

CPP

deque

# Python code to demonstrate deque 
      
    
from collections import deque 
      
# Declaring deque 
queue = deque(['name','age','DOB'])  
      
print(queue)
Comment

Deque

// CPP Program to implement Deque in STL
#include <deque>
#include <iostream>
 
using namespace std;
 
void showdq(deque<int> g)
{
    deque<int>::iterator it;
    for (it = g.begin(); it != g.end(); ++it)
        cout << '	' << *it;
    cout << '
';
}
 
int main()
{
    deque<int> gquiz;
    gquiz.push_back(10);
    gquiz.push_front(20);
    gquiz.push_back(30);
    gquiz.push_front(15);
    cout << "The deque gquiz is : ";
    showdq(gquiz);
 
    cout << "
gquiz.size() : " << gquiz.size();
    cout << "
gquiz.max_size() : " << gquiz.max_size();
 
    cout << "
gquiz.at(2) : " << gquiz.at(2);
    cout << "
gquiz.front() : " << gquiz.front();
    cout << "
gquiz.back() : " << gquiz.back();
 
    cout << "
gquiz.pop_front() : ";
    gquiz.pop_front();
    showdq(gquiz);
 
    cout << "
gquiz.pop_back() : ";
    gquiz.pop_back();
    showdq(gquiz);
 
    return 0;
}
Comment

deque

# Python code to demonstrate deque 
      
    
from collections import deque 
      
# Declaring deque 
queue = deque(['name','age','DOB'])  
      
print(queue)
Comment

deque

# Python code to demonstrate deque 
      
    
from collections import deque 
      
# Declaring deque 
queue = deque(['name','age','DOB'])  
      
print(queue)
Comment

PREVIOUS NEXT
Code Example
Cpp :: Write a C++ program using constructor 
Cpp :: C++ Syntax for Passing Arrays as Function Parameters 
Cpp :: data type c++ 
Cpp :: auto in cpp 
Cpp :: ue4 c++ switch enum 
Cpp :: Check whether the jth object is in the subset 
Cpp :: check if cin got the wrong type 
Cpp :: online converter c++ to c 
Cpp :: InstallUtil.exe ConsoleApp 
Cpp :: Maximum Pairwise Modular Sum codechef solution in c++ 
Cpp :: crud with template c++ 
Cpp :: why the << operator is friend 
Cpp :: Vaccine Dates codechef solution in c++ 
Cpp :: c++ graphics online compiler 
Cpp :: point in polygon 
Cpp :: c++ vector move element 
Cpp :: ++m in c 
Cpp :: function and function prototype. 
Cpp :: is obje file binary?? 
Cpp :: second smallest element in array using one loop 
Cpp :: c++ require keyword 
Cpp :: convert into acsii c++ 
Cpp :: facade pattern C++ code 
Cpp :: input many numbers to int c++ 
Cpp :: command loop ctrl D c++ 
Cpp :: numpy array scalar addition 
Cpp :: c++ find unused class methods 
Cpp :: Snake Procession codechef solution in c++ 
Cpp :: std::hash 
Cpp :: two dimensional matrix using oops concept 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =