Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer the following multiple choice questions and provide a written expl

ID: 3878885 • Letter: P

Question

Please answer the following multiple choice questions and provide a written explanation for each answer.

21. suppose that n-element circular queues are implemented using Java arrays of size n+1 with floating front and rear, so that variable rear stores the index of the rear element, while variable front stores the index preceding the index of the front element. Which condition tests if a queue is empty? a. rear:= 0 b. front == rear c. ( (rear-front) % (n+1) ) d. ( (front-rear) % (n+1)) e. rear-= n+ 1 f. front == 0 g. none of the above 1

Explanation / Answer

21) b) front == rear

In a circular queue , we first insert an element using rear and update it to the next element . Similarly, when we delete an element we delete the element pointed by front and update front to the next element .

So the only case where the queue is empty is when front == rear , where the previously inserted element by rear is deleted by first and now equals rear .

22) f) a descritption of the simple data items of that type .

An abstract data type is basically a logical description or a specification of components of the data and the operations that are allowed, that is independent of the implementation. ADTs are a theoretical concept in computer science, used in the design and analysis of algorithms, data structures, and software systems, and do not correspond to specific features of computer languages.

24) a) ORAM

Let us see step by step , how the function works :