You are on page 1of 2

Algorithm Analysis Quiz Part 1 Results for Dhruv Makwana


Answers will be shown after your last attempt

Score for this attempt:


5 out of 5
Submitted Feb 3 at 7:47pm
This attempt took less than 1 minute.

2
/ 2 pts
Question 1

What would be the Big O Complexity for the following method?

    

    public boolean crossStreet(boolean isSafe, int height, int length) {

    if (isSafe) {

    return true;

    } else if (height < 14) {

    return true;

    } else {

    return length > 23;

    }

    }

 
O(height^2)

 
O(length^2)

 
O(N)

 
O(length)

 
O(height)

 
O(1)

 
O(log length)

1
/ 1 pts
Question 2

What is the Big O notation of the following growth function?

    

    64 n^1 + 12 n^6 + 88 n^3 + 76

 
O(76)

 
O(n^6)

 
O(n^1)

 
O(n^3)

1
/ 1 pts
Question 3

What is the Big O notation for searching in an ArrayList?


 
O(1)

 
O(N^2)

 
O(log(N))

 
O(N)

1
/ 1 pts
Question 4

Which of the following choices demonstrates increasing levels of complexity in Big O notation?

    

 
O(N^2) --> O(NlogN) --> O(N) --> O(logN) --> O(1)

 
O(1) --> O(logN) --> O(N) --> O(NlogN) --> O(N^2)

 
O(logN) --> O(NlogN) --> O(1) --> O(N) --> O(N^2)

 
O(1) --> O(N) --> O(N^2) --> O(logN) --> O(NlogN)

Quiz Score:
5 out of 5

You might also like