A utility function to create a Queue of given capacity
Queue * createQueue ( int capacity ) { Queue * queue = new Queue [ ( sizeof ( Queue ) ) ] ; queue -> front = queue -> rear = -1 ; queue -> capacity = capacity ; queue -> array = new QueueNode * [ ( queue -> capacity * sizeof ( QueueNode * ) ) ] ; return queue ; }