Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
468 views
in Technique[技术] by (71.8m points)

performance - Need help figuring out time complexity of this pseudocode

I am trying to figure out how many primitive operations there are in this code and how many primitive operations are being executed over the runtime of this algorithm:

enter image description here

What have I tried to get the answer so far

I attempted to write the code out onto a piece of paper and go through it line by line. I separated each line into a cost and times ran section in hopes of figuring it out. I ended with T(O) = 2n +6i which seems incorrect.

Here is a snippet of my work: enter image description here

I would greatly appreciate if someone could help me break this problem into concrete steps so I can better understand this topic as a whole.

question from:https://stackoverflow.com/questions/65866356/need-help-figuring-out-time-complexity-of-this-pseudocode

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...