-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython-ds-algo-notes.txt
More file actions
27 lines (21 loc) · 907 Bytes
/
Copy pathpython-ds-algo-notes.txt
File metadata and controls
27 lines (21 loc) · 907 Bytes
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
Kadane's Algorithm - Find Maximum Sub-Array
Floyds Cycle Finding Algorithm - Detect Loop in a Linked List
Time Complexity - lang and meth to describe efficiency of algos
time complexity increases when input increases
Asymptotic Analysis/Bounds
Big-O - Worst Case - less or equal to the worst case, (Maximum time)
Big-Omega - Best Case Scenario - at least more than the best case, (Best Time)
Big-Theta - Average Case Scenario - within bounds of the worst and best case scenarios (Average Time)
o(1) - constant
o(n) - linear
o(LogN) - Logarithmic
o(N2) - Quadratic
o(2n) - Exponential
Space Complexity
Amount of space needed for algorithm to Recursion
It's represented the same way as time complexity
Recursion - When a method calls itself
3 steps
1. Recursive Case
2. Base case - the stopping criterion
3. Unintentional case - the constraint