Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Chemistry Expert

A website streams movies to customers' TVs or other devices. Movies are in one of several genres such as action, drama, mystery, etc. Every movie is in exactly one genre (so that if a movie is an action movie as well as a comedy, it is in a genre called "action-comedy"). The site has around 10 million customers, and around 25,000 movies, but both are growing rapidly. The site wants to keep track of the most popular movies streamed. You have been hired as the lead engineer

to develop a tracking program.

i) Every time a movie is streamed to a customer, its name (e.g. "A Very Harold & Kumar 3D Christmas") and genre ("Comedy") is sent to your program, which then updates the data structures it maintains. (Assume your program can get the current year with a call to an appropriate Java class, in O(1) time.)

ii) Customers want to know what were the top k most streamed movies in genre g in year y. (If y is the current year, then accounting is done up to the current date.) For example, what were the top 10 most streamed comedy movies in 2012? Here k = 10, g="comedy" and y = 2012. This query is sent to your program which should output the top k movie names, in descending order of number of times streamed.

  • a)Describe the data structures used to implement the above.

b)For (i), describe the algorithm, step by step, to update the data structures. Analyze its big O running time.

Show your work. Specify whether the running time is worst case or something else.

c) For (ii), analyze the big O running time to output the top k streamed movies. Describe additional data

structures, if any, used in this process. Show your work. Specify whether the running time is worst case 

Chemistry, Academics

  • Category:- Chemistry
  • Reference No.:- M91574906
  • Price:- $10

Guranteed 24 Hours Delivery, In Price:- $10

Have any Question?


Related Questions in Chemistry

Question 1bonding energyi draw an energy level diagram for

Question 1: Bonding Energy i. Draw an energy level diagram for a single Na ion and Cl ion. ii. Explain what is happening to the energy level between these two ions in terms of the Potential Energy. iii. Which process uti ...

A chemist addsnbsp750 ml of anbsp192mnbspnickelii

A chemist adds 75.0 mL of a 1.92 M  nickel(II) chloride (NiCl2) solution to a reaction flask. Calculate the millimoles of nickel(II) chloride the chemist has added to the flask. Round your answer to 3 significant digits.

A sample consisting of 10 mol caco3s was heated to 800 degc

A sample consisting of 1.0 mol CaCO3(s) was heated to 800 °C, when it decomposed. The heating was carried out in a container fitted with a piston that was initially resting on the solid. Calculate the work done during co ...

Upon decomposition one sample of magnesium fluoride

Upon decomposition, one sample of magnesium fluoride produced 2.55 kg of magnesium and 3.99kg of fluorine. A second sample produced 1.40 kg of magnesium. How much fluorine (in grams) did the second sample produce?

A chemistry lab experiment requires 674 grams of

A chemistry lab experiment requires 67.4 grams of silvernitrate. How many grams of a 15.5% by mass solution of silvernitrate should be used?

What is an example of a cell diagram for a voltaic cell how

What is an example of a cell diagram for a voltaic cell? How do I calculate the standard cell potential for the example of the voltaic cell?

A chemist adds 1900 ml of a 2810-6 moll mercuryi chloride

A chemist adds 190.0 mL of a 2.8*10^-6 mol/L mercury(I) chloride (Hg2Cl2) solution to reaction flask. Calculate the micromoles of mercury(I) chloride the chemist has added to the flask. Round your answer to 2 significant ...

Diagonal relationship and anomalous behaviour of the each

Diagonal relationship and anomalous behaviour of the each element of the periodic table

15 grams of nacl is dissolved completely in a beaker

15 grams of NaCl is dissolved completely in a beaker containing 200mL of water. What is the Na+ concentration in moles/liter in the final solution?

The common charges of an element can be related to the

The common charges of an element can be related to the electron configuration of the element. Why would copper ions have 2 common charges? Explain each of them in terms of the electron configuration.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As