Question: Background: Platform Independent Solution . Please see Syllabus for more information. . Your solution has to be platform-independent; it must run on any platforms including
Background:



Platform Independent Solution . Please see Syllabus for more information. . Your solution has to be platform-independent; it must run on any platforms including any online IDEs: . You solution should be free of any use of packages. Example, absolutely no /* Java Program Example - Java Import Packages */ package YOUR_CUSTOM_PACKAGE HERE; . Your solution, regardless of how many classes it has, should be in one .java file. . Your solution has to run on any online IDEs. . If your solution fails the platform-independence criteria, you will have to resubmit work subject to the late penalty. . Your solution should be reusable, meaning it will be invoked and validated against a series of input sequentially to produce consistent outcomes like so: Solution sol = new Solution(); sol. your_function(test_input_1. . . ) ; sol. your_function(test_input_2 . . .);Problem 1 ( 10 points ) You learn in class as well as in reading about the Array-Based Queue Implementations, specifically the "Floating Front Design" to implement a queue using a fixed-size array. The following two scenarios from your lecture slides illustrate how this design works: Scenario #1 image of the floating front design sequence work flow as illustrated (a) queue . enqueue ( ' A' ) front : O rear : O [o] [1] [2] [3] [4] (b) queue . enqueue ( ' B' ) A B front : rear : 1 [0] [1] [2] [3] [4] (c) queue . enqueue ( ' C' ) A B C front : rear: 2 [O] [1] [2] [3] [4] (d) element queue . dequeue ( ) : B C front : 1 rear : 2 [o] [1] [2] [3] [4]Scenario #2 (a) There is no room at the end of the array K ? front : 3 rear: 5? [0] [1] [2] [3] [4] Ba diagram showing how elements are moved from front to rear in circular fashion in an array (b) Using the array as a circular structure, we can wrap the queue around to the beginning of the array K front : 3 rear : 0 [0] [1] [2] [3] [4] You are responsible for implementing the areas of code indicated with YOUR CODE HERE. This Solution class implements a constructor that builds an array of a dynamic capacity at construction time. In this problem, you will be following the above mentioned Floating Front design in your textbook and lecture, and implement the FOUR (4) solution methods: add()/remove()/peek()/isEmpty(). Note these methods are named differently and both the (front) and (rear) pointers have different initialized values in this problem than what is in the lecture. DO NOT ALTER THEM in your code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
