MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/QUEUE/QueueUsingStack.cpp:31–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30};
31int main(){
32 Queue q;
33 int ch;
34 int x;
35 cout<<"Press 0 to exit else enter 1: ";
36 cin>>ch;
37 while(ch!=0)
38 {
39 cout<<"\n"<<"1.ENQUEUE"<<"\n"<<"2.DEQUQUE"<<"\n";
40 cout<<"\n"<<"Enter choice :";
41 cin>>ch;
42 switch (ch)
43 {
44 case 1:
45 cout<<"Enter the value you want to enqueue: ";
46 cin>>x;
47 q.enqueue(x);
48 break;
49 case 2:
50 cout<<"Dequeued element is : "<<q.dequeue()<<"\n";
51 break;
52
53 default:
54 printf("\nINVALID CHOICE !!");
55 break;
56 }
57 }
58
59
60 return 0;
61}

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.45
dequeueMethod · 0.45

Tested by

no test coverage detected