-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path13-recursive-big-o.js
More file actions
41 lines (28 loc) · 1.83 KB
/
Copy path13-recursive-big-o.js
File metadata and controls
41 lines (28 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Take your solutions from the recursive exercises that you completed in the previous checkpoint and identify the time complexities (big O) of each of them.
// Counting Sheep
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// So counting 30 sheep takes less time than 100 sheep.
// Power Calculator
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// The recursive function gets called everytime you decrease the exponent, which you have to do all the way down to 1.
// So the larger the exponent, the more times we need to recursivly call the function
// Reverse String
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// The recursive function gets called everytime you
// nth Triangular Number
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// String Spliter
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// Fibonacci
// Exponential Time (O(2^n)) has running times that grow rapidly with any increase in input size.
// Factorial
// Linear Time (O(n)) has running times that are directly proportional to the size (n) of the input.
// Maze One Path
// Polynomial Time (O(n^k)) has a running time that would be some input size n raised to some constant power k.
// Maze All Paths
// Exponential Time (O(2^n)) has running times that grow rapidly with any increase in input size.
// Anagrams
// Polynomial Time (O(n^k)) has a running time that would be some input size n raised to some constant power k.
// Organization Chart
// Binary Representation
// Logarithmic Time (O(log(n))) takes longer with larger inputs, but running time increases slowly. Cuts the problem size in half each round.