Consider the table below and answer questions 23 to 25. The table depicts the running time (seconds) dependant on input size (n) of three algorithms Algorithm n = 100 n = 1000 n = 10 000 A 4 400 40 000 B 9 90 900 C 21 31 41 Question 23 What is the running time complexity of algorithm A? 1. O(n) 3. O(log n) 2. O(n2 ) 4. O(2n ) Question 24 What is the running time complexity of algorithm B? 1. O(n) 3. O(log n) 2. O(n2 ) 4. O(2n ) Question 25 What is the running time complexity of algorithm C? 1. O(1) 3. O(log n) 2. O(n) 4. O(1/n
Comments
Leave a comment