# Big-O-Notation Exercise (Jordan Mittelman) #9

Closed
wants to merge 1 commit into
from
+16 −0

## Conversation

Projects
None yet
2 participants

### triplespice commented May 13, 2019

 3 comfort 4 completeness I wasn't able to interpret what some of these functions were doing
``` submission ```
``` ba63bcb ```

### Zakk reviewed May 13, 2019

 @@ -17,6 +17,8 @@ function wordOccurrence(word, phrase) { } ``` O(log(N)) This is logarithmic complexity.

#### Zakk May 13, 2019

Close! There is an `N` in the complexity

### Zakk reviewed May 13, 2019

 @@ -34,6 +36,8 @@ function bubble_sort(list) { } ``` O(N^2) this is quadratic complexity because there is a nested loop

👍

### Zakk reviewed May 13, 2019

 @@ -46,6 +50,8 @@ function factorial(n) { } ``` O(N) This is linear complexity. It goes one step at a time.

👍

### Zakk reviewed May 13, 2019

 @@ -54,6 +60,8 @@ function bobIsFirst(people) { } ``` O(1) This is constant complexity. It is doing one simple thing.

👍

### Zakk reviewed May 13, 2019

 @@ -70,6 +78,8 @@ function isPalindrome(input) { } ``` O(N) This is linear complexity. as it iterates through it goes one step at a time.

👍

### Zakk reviewed May 13, 2019

 @@ -85,6 +95,8 @@ function sumOfDivisors(n) { } ``` O(N!) This is factorial because it keeps looping.

#### Zakk May 13, 2019

Close! There is an `N`

### Zakk reviewed May 13, 2019

 @@ -100,6 +112,8 @@ function printAllNumbersThenSumPairs(numArray) { } ``` O(N^2) this is quadratic complexity because there is a function nested within a function

#### Zakk May 13, 2019

Close! `forEach` is a loop

### Zakk reviewed May 13, 2019

 @@ -115,3 +129,5 @@ function isPrime(num) { return true; } ``` O(N) This is linear complexity. as it iterates through it goes one step at a time.

👍

### Zakk commented May 13, 2019

 @triplespice Very nice! You have a couple to review but I've marked this as complete

### Zakk closed this May 13, 2019

to join this conversation on GitHub. Already have an account? Sign in to comment