in Education by
If the size of the array used to implement a circular queue is MAX_SIZE. How rear moves to traverse inorder to insert an element in the queue? (a) rear=(rear%1)+MAX_SIZE (b) rear=(rear+1)%MAX_SIZE (c) rear=rear+(1%MAX_SIZE) (d) rear=rear%(MAX_SIZE+1) I got this question during an online exam. I would like to ask this question from Data Structures-Queue topic in section java.util – The Collections Framework of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The correct choice is (b) rear=(rear+1)%MAX_SIZE The explanation is: The front and rear pointer od circular queue point to the first element.

Related questions

0 votes
    What is the correct method used to insert and delete items from the queue? (a) push and pop (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Where does a new element be inserted in linked list implementation of a queue? (a) Head of list (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What are the use of front and rear pointers in CircularQueue implementation? (a) Front pointer points to first ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to insert value and its key? (a) put() (b) set() (c) insertElement( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to add an element to the start of a LinkedList object? (a) add() (b ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of this method is used to change an element in a LinkedList Object? (a) change() (b) set() ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method Map class is used to obtain an element in the map having specified key? (a) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of Array class is used sort an array or its subset? (a) binarysort() (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to delete the last element in a LinkedList object? (a) remove() (b ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to move to next element in a collection? (a) next() (b) move() ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these is a method of ListIterator used to obtain index of previous element? (a) previous() (b ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the worst case complexity of accessing an element in ArrayList? (a) O(n) (b) O(1) (c) O( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these is an incorrect form of using method max() to obtain a maximum element? (a) max( ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these class object can be used to form a dynamic array? (a) ArrayList (b) Map (c) Vector ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...