For each of the following program segments,give a big zero
analysis for the running time
1.For (i=0;i<m;i++)
{
//
}
2.For (j=0;j<i;j++)
Answer / Arvind Shukla
[
{
"qno": 182200,
"program": "For (i=0;i<m;i++)",
"analysis": "The Big-O time complexity of this program is O(m) because the loop executes m times."
],
[*
"qno": 182200,
"program": "For (j=0;j<i;j++)",
"analysis": "The Big-O time complexity of this program is O(i^2) because the nested loop executes i times for each iteration of the outer loop, resulting in a total of i*i operations."
]
| Is This Answer Correct ? | 0 Yes | 0 No |
Is jar an executable?
What is native class in java?
What kind of thread is the garbage collector thread?
What is entitymanager in jpa?
What if I do not provide the string array as the argument to the method?
What are the advantages of java 8’s date and time api over old date api and joda time api?
What is @override annotation in java?
What is lambda expression in mvc?
Can an application have multiple classes having main method?
Why is javac not recognized?
What is maven in java?
Does jvm maintain a cache by itself? Does the jvm allocate objects in heap? Is this the os heap or the heap maintained by the jvm? Why