adspace
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 Posted / 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 |
Post New Answer View All Answers
what is reflection api? How are they implemented?
What is the locale class?
Are jvm’s platform independent?
What is the java api?
How does java handle integer overflows and underflows?
What is the resourcebundle class?
What if I write static public void instead of public static void?
What do you understand by casting in java language? What are the types of casting?
What is the first argument of the string array in main method?
Can we extract main method from another class?