What is the time complexity of the following code: int a = 0, b = 0; for (i = 0; i < N; i++) { a = a + rand(); for (j = 0; j < M; j++) b = b + rand(); } Select one: O a. 0(M) O b. O(N) O C. O(N*M) O d. O(N+M)
What is the time complexity of the following code: int a = 0, b = 0; for (i = 0; i < N; i++) { a = a + rand(); for (j = 0; j < M; j++) b = b + rand(); } Select one: O a. 0(M) O b. O(N) O C. O(N*M) O d. O(N+M)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps