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

  Write code to ask the user how many honor students

Write code to ask the user how many honor students he wishes to add. Then read in from the user using the Scanner class the name.

  Test your function with three different integer arrays

Write a function, named avg, that receives an array of integer values and returns the average of those values in that array.

  Design a logical and physical topographical layout

CIS599 Design a logical and physical topographical layout of the planned network through the use of graphical tools in Microsoft Word or Visio.

  Print a list of the perfect numbers

Print a list of the perfect numbers between 1 and 100 ;

  Determine how would you plan to store your data

Besides using the Hard Disk Drive, how would you plan to store your data? Explain your answer using at least 3 sentences. List at least 1 External Drive Bay.

  Web security consulting recommendations

Web Security Consulting Recommendations You are a security consultant for a new client in the healthcare industry. You have been asked to design a web solution

  Why would the investigator be considered with eeprom

Why would the investigator be considered with EEPROM? Explain the important points in evaluating dates and times on a device?

  Determine the high- and low-level noise immunities

Draw the circuit diagram of a three-input CMOS NOR gate with one input at 0 V and the other inputs at V, showing all the voltage levels.

  1 in platosrepublic glaucon presents a three-part argument

1. in platosrepublic glaucon presents a three-part argument meant to show that justice is not natural but rather

  Distinguish between a parameter and an argument

Distinguish between a parameter and an argument. Distinguish between a value parameter and a reference parameter.

  Explain protocol and architecture

define Connection Oriented Protocol and Connectionless Protocol.

  Developing a pseudocode and the flowchart

Develop a flowchart or puesdocode that carry out the following task:. a) Begin the program. b) Declares the strings. c) Accept an input studentname.

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