What is the big oh running time for each implementation

Assignment Help Computer Engineering
Reference no: EM133241294

Question: A Pizzeria offers M different kinds of pizzas (let's assume that the pizza kind is a number between 0 and M-1). In order to serve its clients quickly, the pizzeria cooks pizzas in advance. Let's say that at a given moment, the pizzeria has N pizzas ready of different kinds, with N>>M. When a client orders a pizza of a given kind, it receives the pizza of that kind that has been cooked since the longest time (to avoid wasting pizzas). A client has also the possibility of ordering a surprise pizza, that is the client does not choose the kind of pizza but gets the pizza at a lower price. In that case, the pizzeria gives to the client the oldest pizza of all pizzas prepared.

do an algorithm, for each of the following operations:

addPizza(kind)

getPizza(kind)

getSurprisePizza()

What is the Big Oh running time for each implementation of these operations?

For full marks the time of each operation should not depend on the total number of pizzas N; otherwise, the maximum will be 4 marks. You may use other data structures seen in class to implement your data structure. You can write your algorithms in pseudocode or Java-like code. You may call system.currentTime() when you create a pizza. You may assume the existence of a class Pizza with the following methods: getKind() getTime().

Reference no: EM133241294

Questions Cloud

Medication safety for malcolm : Background Mr. Malcolm Reddy is an 84-year-old man who has had hypertension and hypercholesterolemia for many years. He also has episodic angina.
What factors affect the transmission of data in the channel : What factors affect the transmission of data in the channel? Can the signal-to-noise ratio be arbitrarily increased? What is the significance of Shannon's
Write paper analyzing a personal experience : ISM-350 Wilmington University Write paper analyzing a personal experience related to technology's influence on a purchase
Does your state currently participate in hispc : Does your state currently participate in Health Information Security and Privacy Collaboration (HISPC)
What is the big oh running time for each implementation : What is the Big Oh running time for each implementation of these operations - You may assume the existence of a class Pizza with the following methods
Taking responsibility for your criminal activity : ITC 4313 Columbia Southern University taking responsibility for your criminal activity or supporting your family. There is no grey area. Choose your action
Find priority interventions that impact global health : As part of a monthly in-service focus group in your global health organization, you have been asked to create a memo focusing on epidemiological interventions t
Discuss risks and nursing considerations : Discuss risks and nursing considerations associated with age-related changes.
Summarize the benefits of moving from a company : IT C948 Western Governors University Summarize the benefits of moving from a company-owned data center to a cloud environment in an upbeat way (change is scary)

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