Assignment 03
Assignment 03
Requirements:
Question 1 - Part B
Implement a circular queue in Java using an array. Your circular queue should support the
following operations:
1. enqueue(int value): Adds an element to the rear of the queue. If the queue is full, display
an appropriate message.
2. dequeue(): Removes an element from the front of the queue. If the queue is empty,
display an appropriate message.
3. peek(): Returns the front element without removing it.
4. isEmpty(): Checks if the queue is empty.
5. isFull(): Checks if the queue is full.
Requirements:
Requirements:
Question 2 - Part B
Write a Java program that allows a user to search for an integer in an array using search
algorithms ‘Linear Search’ and ‘Binary Search’. The program should contain separate methods
for each search algorithm and print the position of the integer if it is found or indicate if it is not
found.
Requirements: