# big o exercise(Jung Park) #1

Closed
wants to merge 1 commit into
from
+8 −3

## Conversation

Projects
None yet
2 participants

### jung341416 commented May 13, 2019

 complete :4 comfort : 2.8 i wasnt so sure.
``` big o exercise ```
``` e15e64a ```

### Zakk reviewed May 13, 2019

 @@ -16,7 +16,7 @@ function wordOccurrence(word, phrase) { return result; } ``` this function runs O(2n) worst case scenario for this function is it loops throught at the end and return result.

Close!

### Zakk reviewed May 13, 2019

 @@ -33,6 +33,7 @@ function bubble_sort(list) { return list; } ``` -this function runs O(n)**2(quadratic time). worst case scenario would be its gonna loop throught at the end because input list fits the condition and return the result.

Close!

### Zakk reviewed May 13, 2019

 @@ -45,14 +46,15 @@ function factorial(n) { } } ``` this function runs O(1) constant wosrt case scenario would be if n is not equal to 0

Close!

### Zakk reviewed May 13, 2019

 #### #4 ```javascript function bobIsFirst(people) { return people[0] == "bob"; } ``` - the function runs in 0(1)time worst case scenairo would be if people[0] is not equal to bob.

👍

### Zakk reviewed May 13, 2019

 @@ -69,7 +71,7 @@ function isPalindrome(input) { return output == input; } ``` this function runs O(N)(linear) worst case senario would be larger input array.

👍

### Zakk reviewed May 13, 2019

 @@ -84,6 +86,7 @@ function sumOfDivisors(n) { return result; } ``` this function runs O(N) worst case scenario would be n is larger number.

👍

### Zakk reviewed May 13, 2019

 @@ -99,6 +102,7 @@ function printAllNumbersThenSumPairs(numArray) { }); } ``` -the function runs in O(2*n)time(linear time) worst case scenario would be larger num Array and index input is smaller.

Close!

### Zakk reviewed May 13, 2019

 @@ -115,3 +119,4 @@ function isPrime(num) { return true; } ``` this function O(n)(linear) worse case secnario would be number is larger number and loop throught at the end.

👍

### Zakk commented May 13, 2019

 @jung341416 You got 4 out of 8. We'll mark this as incomplete for now, giving you a week to resubmit it. Can you complete 2-3 of these? When you do, slack Hamamd or I so we know to regrade it!