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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, safi30360oz0c34
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
image
Computers and Technology, 22.06.2019 19:30, bstine6678
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, puppylove899
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, Disd112984
Which statement is true of web-based social media? a. they allow consumers to interact with and update content. b. they cannot be updated easily, as compared to print media. c. they are expensive to produce and maintain, as compared to print and television. d. they can exist independent of the internet.
Answers: 1
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 in other subjects:

Konu
Advanced Placement (AP), 25.01.2021 21:20
Konu
Mathematics, 25.01.2021 21:20