A linear queue held in an array of capacity 5 has front = 2 and rear = 4. How many elements does it hold, and can a further element be inserted?
Queues
Original Khojo Papers practice question — not from a past board paper.
If front is greater than rear, or front is −1, report underflow. Otherwise take the element at a[front], increment front by one, and if front now exceeds rear reset both front and rear to indicate an empty queue.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
Insertion works at the rear and deletion at the front, which is what makes the structure first-in-first-out.
From the same topic and chapter, at a similar level.
A linear queue held in an array of capacity 5 has front = 2 and rear = 4. How many elements does it hold, and can a further element be inserted?
Queues
What is a circular queue and what problem does it solve?
Queues
What is a queue? State two differences between a stack and a queue.
Queues
Write a recursive Java method to compute the factorial of a non-negative integer n.
Recursion
State and verify the absorption law X + X·Y = X using a truth table.
Boolean Algebra
Convert the Boolean expression F(A, B, C) = Σ(1, 3, 5) into its canonical sum of products form.
Boolean Algebra