You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem : https://www.geeksforgeeks.org/problems/implement-queue-using-array/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=implement-queue-using-array
*/
class MyQueue {
int front, rear;
int arr[] = new int[100005];
MyQueue()
{
front=0;
rear=0;
}
//Function to push an element x in a queue.
void push(int x)
{
arr[front]=x;
front++;
}
//Function to pop an element from queue and return that element.