Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me understand this better. I'm not sure why the answer is not 5. What is the exact number of statements that get

Can someone help me understand this better. I'm not sure why the answer is not 5.

What is the exact number of statements that get executed when running the following snippet of code if n = 5?

 int i = n; while(i > 0) { System.out.print("*"); i--; }

Were learning big-oh notation, and i'm not understanding why this statement does not run 5 times.

please help thank you.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

Explain how informal groups utilize the grapevine.

Answered: 1 week ago

Question

What is a numerical value that is computed from a census called?

Answered: 1 week ago