Computers and Technology

Suppose we perform a sequence of n operations on a data structure such that if some condition C(k) holds then the kth operation takes O(k) time, but otherwise it only takes O(1) time. For each condition C(k) listed below, determine the total time T(n) for the sequence of all n operations, and also the amortized time Tamortized(n) per each operation

a) If C(k) is "k is a power of 3" then T(n)-O(n4/) and Tamortized(n) O(n13).
b) If C(k) is "k is a multiple of 2" then T(n)-O(n) and Tamortized(n)=O (1).
c) If C(k) is "k is a perfect square" then T(n) O(n4/3) and Tamortized(n)=O(n13). O
d) If C(k) is "k is a multiple of 2" then T(n)=O(n2) and Tamortized(n)=O(n)

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:40, Morghurley2000
"it security policy enforcement and monitoring" respond to the following: describe how monitoring worker activities can increase the security within organizations. describe the rationale that managers should use to determine the degree of monitoring that the organization should conduct. explain the extent to which you believe an organization has the right to monitor user actions and traffic. determine the actions organizations can take to mitigate the potential issues associated with monitoring user actions and traffic.
Answers: 3
image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 22.06.2019 22:50, youngboymark123
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, naomirice24
In a heat transfer course, we can derive the equation for the temperature distribution in a flat rectangular plate. in this example, we will look at a plate at steadystate with three sides being held at t1, and one side held at t2. the temperature for any location on the plate, t(x, y), can be calculated by where create a function (prob3_5) that will take inputs of vectors x and y in feet, scalar n, scalars l and w in feet and scalars t1 and t2 in degrees fahrenheit. it will output a matrix t which is the temperature of each x and y locations. t will have the number of columns equal to the number of elements in x and rows equal to the number of elements in y. though this can be done without loops (perhaps more efficiently), your program must use a nested loop.
Answers: 2
Do you know the correct answer?
Suppose we perform a sequence of n operations on a data structure such that if some condition C(k) h...

Questions in other subjects: