Create a class to implement a queue using a circular array[20 marks]
a. The class should contain functions to
i. Insert a new value, [5 marks]
ii. Delete a value. [5 marks]
iii. Change a value equal to X to a value equal to Y.[5 marks]
iiii. Count all value equal to X in the queue. [5 marks]
b. For each function above perform an asymptotic analysis and state the worst case performance of the algorithm[5 marks]
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]
Explain the use of the binary heap as an effective implementation for a priority queue .
a. Describe the concept of a Binary heap and the heap order property.
1.Create a class to implement a queue using a circular array<o:p></o:p>
a. The class should contain functions to
i. Insert a new value
ii Delete a value.
iii. Change a value equal to X to a value equal to Y.
iv. Count all value equal to X in the queue.
For each function above perform an asymptotic analysis and state the worst case performance of the algorithm
Passenger fare is classified according to the type of passenger. Senior Citizen enjoys 20% discount from the regular fare, Students get 10% discount. Regular passengers who do not qualified as neither Senior Citizen nor a Student should pay the regular fare of 100. Write an algorithm that will accept details of five (5) passengers, including its name and passenger type and will compute for the corresponding fare of each passenger. Display the name and type of passenger, as well as the computed fare.
Rizal Technological University is accepting applicants for its scholarship program. A student will receive scholarship if the high school academic rating average is above 95 or the number of varsity letters earned is at least 10 and the high school academic rating is above 75. RTU will grant scholarship only for the first 50 qualified students. Write an algorithm and draw a flowchart that will determine the first 50 successful applicants.
with the use of switches, draw a flowchart and algorithm that will determine and print out the sum of all even and odd integer numbers from 1 to 20. note that the sum of even integer number for the given range would be equal to the sum of 2,4,6,8,10,12,14, 16, 18, 20 and for odd integer number it would be 1, 3, 5, 7, 9, 11, 13, 15, 17, 19.
draw a flowchart and write an algorithm that will compute for the average and will read and print the names and individual scores of 100 students for a particular examination