Give a big-O estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm: t := 1 for i = n to n^2 t := t + 2it Show all steps.
Added by Sarah G.
Step 1
This gives us a complexity of O(1). ** Show more…
Show all steps
Close
Your feedback will help us improve your experience
Sri K and 78 other Calculus 3 educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Give a big- $O$ estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm. $$ \begin{array}{c}{t :=0} \\ {\text { for } i :=1 \text { to } 3} \\ {\quad \text { for } j :=1 \text { to } 4} \\ {t :=t+i j}\end{array} $$
Algorithms
Complexity of Algorithms
Give the big-O estimate for the number of operations where an operation is an addition or a multiplication, used in this segment of an algorithm (ignoring comparison used to test the condition in the while loop). i:=1 t:=0 while i < n t:= t+2i i:= i+1
Nick J.
Give a big- $O$ estimate for the number additions used in this segment of an algorithm. $$ \begin{array}{c}{t :=0} \\ {\text { for } i :=1 \text { to } n} \\ {\text { for } j :=1 \text { to } n} \\ {t :=t+i+j}\end{array} $$
Recommended Textbooks
Calculus: Early Transcendentals
Thomas Calculus
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD