CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 05:38:46 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=6cddad32c957bda59ea73b175e3a42ad712bbfaf01d5788ad867064aaec672a6a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22x5ncvxW4WBUv3-zB4JnJRny1v9gqB7Bw%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d440bea80fc1b5-BLR
#include <iostream>using namespace std;class node{ public: int d - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class node{
- public:
- int data;
- node *next;
- node(int d){
- data = d;
- next=NULL;
- }
- };
- class queue{
- public:
- node*front;
- node*rear;
- queue(){
- front=NULL;
- rear=NULL;
- }
- void enqueue(int x);
- void dequeue();
- void print();
- };
- void queue :: enqueue(int x){
- node* p = new node(x);
- //p->data=x;
- if(rear==NULL){
- rear=p;
- front=rear;
- rear->next=NULL;
- front->next=NULL;
- }else{
- rear->next=rear;
- rear=p;
- }
- }
- void queue :: dequeue(){
- if(front == NULL){
- cout<<"List is empty"<<endl;
- }else{
- front=front->next;
- }
- }
- void queue :: print (){
- if(front==NULL){
- cout<<"List is empty"<<endl;
- }else{
- node *p=front->next;
- while(p != NULL){
- cout<<p->data;
- p=p->next;
- }
- cout<<rear->data;
- }
- }
- int main()
- {
- queue q;
- q.enqueue(1);
- q.enqueue(2);
- q.enqueue(3);
- q.enqueue(4);
- q.enqueue(5);
- q.enqueue(6);
- q.enqueue(7);
- q.enqueue(8);
- q.print();
- /*cout<<"After delete"<<endl;
- q.dequeue();
- q.print();*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ 8
JavaScript | 5 sec ago | 0.25 KB
-
⭐✅ Swapzone Glitch ✅ Working ⭐⭐ L
JavaScript | 9 sec ago | 0.25 KB
-
📌 Instant BTC Profit Method ✅ Working
JavaScript | 11 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ O
JavaScript | 14 sec ago | 0.25 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ H
JavaScript | 18 sec ago | 0.25 KB
-
📝 Crypto Swap Glitch ✅ Working
JavaScript | 21 sec ago | 0.24 KB
-
⭐✅ Swapzone Glitch ✅ Working ⭐⭐ 9
JavaScript | 23 sec ago | 0.25 KB
-
📌 Swapzone +37% glitch ⭐ 5
JavaScript | 27 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand