deque in data structure java
Double-Ended Queue in Data Structure java public class dequeue_ex { int front =- 1 , rear =- 1 ; int size = 5 ; int [] myarr = new int [ size ] ; public void enqueueFront ( int data){ if (( front == 0 && rear ==( size - 1 )) || front == rear + 1 ){ System. out .println( "overflow" ) ; } else if ( front ==- 1 && rear ==- 1 ){ front = rear = 0 ; myarr [ front ]=data ; } else if ( front == 0 ){ front = size - 1 ; myarr [ front ]=data ; } else { front -- ; myarr [ front ]=data ; } } public void enqueuRear ( int data){ if (( front == 0 && rear ==( size - 1 )) || front == rear + 1 ){ System. out .println( "overflow" ) ; } else if ( front ==- 1 && rear ==- 1 ){ front = rear = 0 ; myarr [ rear ]=data ; } ...