Explain the cost model and recurrence

Assignment Help Computer Engineering
Reference no: EM132098875

Please implement in Java. Experts keep implementing this in C++.

Suppose you work for a major airline and are given the job of writing the algorithm for processing upgrades into first class on various flights. Any frequent flyer can request an upgrade for his or her up-coming flight using this online system.

Frequent flyers have different priorities, which are determined first by frequent flyer status (which can be, in order, silver, gold, platinum, and super) and then, if there are ties, by length of time in the waiting list.

In addition, at any time prior to the flight, a frequent flyer can cancel his or her upgrade request (for instance, if he or she wants to take a different flight), using a confirmation code they got when he or she made his or her upgrade request.

When it is time to determine upgrades for a flight that is about to depart, the gate agents inform the system of the number, k, of seats available in first class, and it needs to match those seats with the k highest-priority passengers on the waiting list.

Design a system that can process upgrade requests and cancellations in O(log n) time and can determine the k highest-priority flyers on the waiting list in O(k log n) time, where n is the number of frequent flyers on the waiting list.

1. Write a program that interactively allows the user to choose one of the following options

tiny_mce_markergt; PassengerList

1. Request upgrade

2. Cancel upgrade

3. Print upgrade list

Make a choice (1-3):

Choosing 1 or 2 should further ask for a passenger name and frequent flyer status.Take appropriate action (ie add or remove them from the list).

Choosing 3 should prompt user to enter a number for k (the number of available seats in first class) and prints the list of upgrade passengers

2. Explain (in README) the cost model and recurrence and prove that the algorithm operates in O(klogn).

Reference no: EM132098875

Questions Cloud

Define a static method that takes two float parameters : Define a static method that takes two float parameters and return a Float (wrapper class) value of the division result of the two parameters.
What is the model-view-controller design pattern : What is the Model-View-Controller design pattern and how is it helpful?
Establishment of a new milk cooperative : On the basis of this analysis, would you support using government resources to encourage the establishment of a new milk cooperative? Why or why not?
Calculate monthly payment by calling the other function : Test your program by getting the data from the user by using the function and calculate monthly payment by calling the other function. Write comments.
Explain the cost model and recurrence : Explain (in README) the cost model and recurrence and prove that the algorithm operates in O(klogn).
In how many ways can this be done if professor blue refuses : In how many ways can this be done if Professor Blue refuses to chair the discrete mathematics committee?
Establishment of a new milk cooperative : On the basis of this analysis, would you support using government resources to encourage the establishment of a new milk cooperative? Why or why not?
How much the week-long vacation is worth to you : What does your decision to go or not go to the beach tell you about how much the week-long vacation is worth to you?
Draw a supply-demand diagram that shows : Assume that the government imposes a minimum wage of $6.00 an hour. Draw a supply-demand diagram that shows what the impact of minimum wage would be.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Find a lower interest rate

how much does it lower your payment if you shop around and find a lower interest rate? How much could you lower the payment by having a bigger down payment? What happens if you extend the term of the loan.

  Determine who is attending conferences and events

Determine who is attending conferences and events. This will promote fostering relationships and ensure coverage of conferences that are considered of high importance.

  What medium would you recommend and why

GJ Enterprises has hired you as a productivity consultant. What medium would you recommend, and why?

  Write a class that encapsulates a deck of cards

Write a class (and a client class to test it) that encapsulates a deck of cards. A deck of cards is made up of 52 cards. You should have three instance variables.

  Why did not ansi prescribe exact sizes for primitive data

Why didn't ANSI prescribe exact sizes for the primitive data types? Is it possible for one machine to have the same size for int and long?

  Estimate temperature distribution in the wall around tube

Helium flows through a thin-walled 1.25 cm diameter circular tube at a mean velocity of 6 m/s under the following conditions at a particular point.

  Determine the centroids of the quantization regions

[Determining the Centroids] Determine the centroids of the quantization regions for a zero-mean, unit-variance Gaussian distribution.

  Explain why are the hierarchical levels of an ea framework

you work at a large federal agency. a colleague proposes that the agency ea is no longer required because the agency

  Briefly scan files and familiarize yourself with the data

ASSIGNMENT - ALL ABOUT MMIS 646. Briefly scan the files and familiarize yourself with the data. How experience in InfoVis is related to the score

  Recommend the proper audit controls to be employed

Analyze proper physical access control safeguards and provide sound recommendations to be employed in the registrar's office. Recommend the proper audit controls to be employed in the registrar's office.

  Explain virtual memory and the process

Explain virtual memory and the process that is followed when virtual memory is used. Explain the difference between a page hit and a page fault.

  Explain how other firms employ this concept of intangibles

what is values-based service? how can a company create value for customers and other stakeholders?values-based service

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd