Pabon_SEC

queue

Aug 18th, 2015
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<iostream>
  2. #include<queue>
  3.  
  4. using namespace std;
  5.  
  6. queue<int>Q;
  7.  
  8. int main()
  9. {
  10.  
  11.     Q.push(10);
  12.     Q.push(15);
  13.     Q.push(8);
  14.     Q.push(3);
  15.  
  16.     Q.pop();                  // 10 delete হয়ে  গিয়েছে ।
  17.  
  18.     cout<<Q.front()<<endl;    //    কিউ এর front value এখন 15 ।
  19.  
  20.     cout<<"\nPrinting remaining values of queue : \n\n";
  21.  
  22.  
  23.     while(!Q.empty())
  24.     {
  25.         cout<<Q.front()<<endl;
  26.         Q.pop();
  27.     }
  28.  
  29.     // এখানে empty() ফাংশনটি  কিউ খালি হয়েছে কিনা তা check করে ।
  30.  
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment