subject

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)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
You know the right answer?
Suppose we perform a sequence of n operations on a data structure such that if some condition C(k) h...
Questions
question
Mathematics, 06.09.2020 03:01
question
Mathematics, 06.09.2020 03:01
Questions on the website: 13722367