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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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