Data Structures/Queue/Double Ended Queue.cpp
//operations on the double ended queue

operations on the double ended queue
operations on the double ended queue
void Deque::enqueueFront()
{
    int val;
    std::cout << "Enter the value to be inserted: " << std::endl;
    std::cin >> val;
    if (isFull())
    {
        std::cout << "Overflow" << std::endl;
        return;
    }
    else if (rear == -1 && front == -1)
    {
        rear = 0;
        front = 0;
    }
    else if (front == 0)
    {
        front = maxSize - 1;
    }
    else
    {
        front--;
    }
    deque[front] = val;
}
void Deque :: enqueueFront ( ) { int val ; std :: cout << " " << std :: endl ; std :: cin >> val ; if ( isFull ( ) ) { std :: cout << " " << std :: endl ; return ; } else if ( rear == -1 && front == -1 ) { rear = 0 ; front = 0 ; } else if ( front == 0 ) { front = maxSize - 1 ; } else { front -- ; } deque [ front ] = val ; }
operations on the double ended queue
operations on the double ended queue
// deque[front] = val;
 // to enqueue front on the first element, we have to point front towards the end of the array.
 // deque[front] = val;
 // pointing front to the previous space
 // deque[front] = val;
