Design an algorithm that minimises Ccmp, the number of comparisons of two books’ labels in the alphabetical order, and Cmov, the number of book movements (one movement is counted whenever a book is moved from one location to another) in the worst case. Suppose there arenbooks on the main shelf, which haveal ready been sorted in an ascending alphabetical order. The m newly arrived books are carried into the library on a portable shelf.
a) Scenario 1: The newly arrived books have also been sorted in an ascending alphabetical order and you are allowed to use a temporary shelf of an infinite capacity. Design an algorithm (description + pseudo code) for the robot to arrange the new books onto themain shelf using Ccmp=Θ(n+m) label comparisons and Cmov=Θ(n+m) book movements in the worst case. Explain why your algorithm has the stated worst case complexity (ignoring the constant and choosing the dominant term in your analysis).
Algorithm ArrangingBooksScenario1(A,B,C,n,m)
//A,B, and C represent the arrays of book labels for the main, the portable, and the temporary shelves
//COMPLETE WITH YOUR PSEUDO CODE HERE
b) Scenario 2: There is no temporary shelf to use in the library and the number of newly arrived books,m, is a small constant compared ton, for instance,m=10. Design an algorithm (description + pseudo code) for the robot to arrange the new books onto the main shelf using Ccmp=Θ(log(n)) label comparisonsin the worst case. What is the number of book movements Cmov incurred in the worst-case of your algorithm and why?
Algorithm ArrangingBooksScenario2(A,B,n,m)
// A and B represent the arrays of book labels for the main and the portable shelves
//COMPLETE WITH YOUR PSEUDO CODE HERE
P/s: I have already posted this question, but haven't received a useful idea for it. So, please help me with a useful idea and more detailed pseudocode.
In: Computer Science
In: Operations Management
Consider 2 airplane manufacturers that compete as Cournot duopolists in the market for commercial aircraft. Arrowing (firm A) has a cost function given by ?(??)=?/???, whereas SkyTrain (firm S) has a cost function given by ?(??)=?/???^?. The market demand function for commercial airliners is given by:?=???−?? where ?is the sum of the quantity of planes available for purchase.
a)If firm A chooses output first, find the Stackelberg equilibrium quantities supplied by each firm and find the equilibrium price.
In: Economics
2) You have been assigned to create a missile warhead reentry nose cone. Describe the properties needed for the nose cone. ?
Please explain in clear words. Thanks
In: Chemistry
Suppose a student failed to dry (remove the water from) the KHP before using it to standardize the NaOH solution. What effect would this have on the calculated molarity of the NaOH solution?
|
|||
|
|||
|
Suppose a student failed to dry (remove the water from) the KHP before using it to standardize the NaOH solution. What effect would this have on the calculated equivalent mass of the unknown acid?
|
|||
|
|||
|
|
Suppose a student performing this experiment calibrated the pH meter using the pH 6 buffer instead of the pH 7 buffer. As a result, all the pH meter readings were too low. What effect would this procedural error have on the experimentally determined pKa of the unknown acid?
|
||||||||||||
In: Chemistry
In the assigned readings and videos, the Heritage Foundation and Peter Sagal seem at odds in their respective positions toward the 14th Amendment and the evolution of equal protection. How do you reconcile equality versus equity in public education today? You must support your position with examples from case law, the U.S. Constitution, or other readings.In the assigned readings and videos, the Heritage Foundation and Peter Sagal seem at odds in their respective positions toward the 14th Amendment and the evolution of equal protection. How do you reconcile equality versus equity in public education today? You must support your position with examples from case law, the U.S. Constitution, or other readings.
CITE FOR BOOK OR WEBSITE ALSO PLEASE
please give a cite, a book or website works doesnt need to be apa
In: Psychology
Lindon Company is the exclusive distributor for an automotive product that sells for $48.00 per unit and has a CM ratio of 30%. The company’s fixed expenses are $324,000 per year. The company plans to sell 26,500 units this year.
A. Assume that by using a more efficient shipper, the company is able to reduce its variable expenses by $4.80 per unit. What is the company’s new break-even point in unit sales and in dollar sales? What dollar sales is required to attain a target profit of $180,000?
In: Accounting
Discuss how you would network a university with two campuses, taking into account the various sections of that campus (computer labs, health clinic, offices, security post, etc), discussing the choice of technologies, devices, topology/topologies, network types, protocols and anything else you would use and justifying your choices
In: Computer Science
For the prelab assignment, you may not use the if statement nor may you use the if/else statement. You are to write a program that calculates factorials from 1 up to and including a maximum number given by the user. Because factorials get large quickly, use long unsigned int as the type for the number entered by the user as well as the factorials you are calculating. If the user enters a 0, print an error message. Then ask if the user wishes to continue the program or quit.
In: Computer Science
Suggest one or more analysis pattern for the following application domains: PLEASE DO NOT HAND WRITE THE ANSWER!! PLEASE ANSWER ALL PARTS OF THE QUESTION!!
A) Accounting Software
B) Email software
C) Internet Browsers
D) Word - Processing software
E) Website creation software
In: Computer Science
Q#1: Take a real-world scenario and Implement it in
C++ program. Your program
should consist of the following:
1. Constructors
2. Pointers
3. Private and Public keywords
4. Reference by return
5. Const keyword
6. Passing Object as argument
In: Computer Science
In: Psychology
IN PYTHON 3 LANGUAGE
Define a recursive function named immutify; it is passed any data structure that contains int, str, tuple, list, set, frozenset, and dict values (including nested versions of any of these data structures as an argument). It returns an immutable equivalent data structure (one that could be used for values in a set or keys in a dict). The types int, str, and frozenset are already immutable. Convert a set to a frozenset; convert all the values in a tuple to be their immutable equivalents, in the same order); convert a list to a tuple (with immutable equivalents of its values, in the same order); convert a dict to tuple of 2-tuples (see the association tuple in question 2) but here with the 2-tuples sorted by the dict’s keys. If immutify ever encounters a value of another type (e.g., float) it should raise a TypeError exception.
The following call (with many mutable data structures)
Example 1:
immutify( {'b' : [1,2], 'a' : {'ab': {1,2}, 'aa' : (1,2)}} )
returns the immutable data structure
(('a', (('aa', (1, 2)), ('ab', frozenset({1, 2})))), ('b', (1, 2)))
Example 2:
immutify( [{1,2}, {3,frozenset([4,5])}, {6,7}])
Returns
(frozenset({1, 2}), frozenset({3, frozenset({4, 5})}),
frozenset({6, 7}))
In: Computer Science
Arrange these elements in order of increasing atomic size: Al, B, C, K, Na.
In: Chemistry
In: Operations Management