Draw the (1)stack and (2)circular queue data structures in array implementation for "each step" in the following sequence :add(A),add(B), add(C), remove, add(D), add(E), remove, add (F), add(G). Assume the initial size of 5 for array implementation. Remember to show TOP(top of the stack) for stack and both Front and back for queue. In circular queue implementation assume we sacrifice one storage for telling the difference between FULL and EMPTY.
This path follow the last posted once:
Application Class The application class must have methods that do the following Adds a new car Sells a car Decreases the price of a specific car by a percentage provided by the user Displays the registration numbers and prices of all the cars that are not cheap.
You need to implement a program for a car salesman who wants to keep record of the cars he has for sale. For each car he keeps the following: Registration Number (always unique), Model, Colour and Price Implement the following classes Class Car It must have a constructor, the necessary Get and Set methods, as well as the following methods: public boolean isCheap() // returns TRUE if the car is selling for under R10000.00 public void decreasePrice(double Amount) // decreases the selling price by Amount public void Display() // displays the Registration Number and Price of a car Class CarList It must contain the standard methods you would expect in a list class. The class must be able to interact with a data file (in other words, get initial data from a data file, and write the final data to a data file), and uses ArrayLists to implement a list
In this exercise, use the following <span style="text-decoration-line: none;">variables</span>: i,lo, hi, and result. Assume that lo and hi each are associated with an int and that result refers to 0.
Write a while loop that adds the integers from lo up through hi (inclusive), and associates the sum with result.
Your code should not change the values associated with lo and hi. Also, just use these <span style="text-decoration-line: none;">variables</span>: i,lo, hi, and result.
Using the graph below,
a. Draw an adjacency list and matrix. [5 MARKS EACH]
b. Perform a depth first search using Vertex C as your source draw the resulting depth first search tree [10MARKS]