Question
int a = 0;
for (i = 0; i < N; i++)
{
for (j = N; j > i; j--)
{
a = a + i + j;
}
}
a.
O(N)
b.
O(N*log(N))
c.
O(N * Sqrt(N))
d.
O(N*N)
Posted under Data Structures and Algorithms
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the time complexity of following code:
Similar Questions
Discover Related MCQs
Q. The worst case occur in quick sort when
View solution
Q. What does it mean when we say that an algorithm X is asymptotically more efficient than Y?
View solution
Q. The complexity of Fibonacci series is
View solution
Q. The worst case complexity for insertion sort is
View solution
Q. The worst case complexity of quick sort is
View solution
Q. To measure Time complexity of an algorithm Big O notation is used which:
View solution
Q. If for an algorithm time complexity is given by O(1) then complexity of it is:
View solution
Q. If for an algorithm time complexity is given by O(log2n) then complexity will:
View solution
Q. If for an algorithm time complexity is given by O(n) then complexity of it is:
View solution
Q. If for an algorithm time complexity is given by O(n²) then complexity will:
View solution
Q. If for an algorithm time complexity is given by O((3/2)ⁿ) then complexity will:
View solution
Q. The time complexity of binary search is given by:
View solution
Q. The time complexity of linear search is given by:
View solution
Q. Time complexity of binary search algorithm is constant.
View solution
Q. Which is the best data structure for round robin algorithm for CPU scheduling?
View solution
Q. Which algorithm is having highest space complexity?
View solution
Q. If the array is already sorted, then the running time for merge sort is:
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!