update max015,
This commit is contained in:
BIN
T11/ans/1.xlsx
Normal file
BIN
T11/ans/1.xlsx
Normal file
Binary file not shown.
BIN
T11/ans/P01_a.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P01_a.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P01_b.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P01_b.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P01_c.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P01_c.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P01_d.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P01_d.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P01_e.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P01_e.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P02_draw.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P02_draw.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/P02_order.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/P02_order.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/ans.docx
Normal file
BIN
T11/ans/ans.docx
Normal file
Binary file not shown.
48
T11/ans/main.md
Normal file
48
T11/ans/main.md
Normal file
@@ -0,0 +1,48 @@
|
||||
## P01:
|
||||
|
||||
a. true
|
||||
b. true
|
||||
c. true
|
||||
d. false
|
||||
e. false
|
||||
|
||||
## P02:
|
||||
|
||||
__growth rates: 1 slowest, 6 fastest__
|
||||
|
||||

|
||||
|
||||
## P03:
|
||||
|
||||
 + 
|
||||
|
||||
=> 
|
||||
|
||||
## P04:
|
||||
|
||||

|
||||
|
||||
## P05:
|
||||
|
||||
```python
|
||||
def myFunction(n):
|
||||
for i in range(n): # O(n)
|
||||
for j in range(i, i * i): # O(i^2 - i) => O(n^2 - n) => O(n^2)
|
||||
if j % i == 0: # O(1) # Check if j is divisible by i
|
||||
for k in range(j): # O(n!)
|
||||
print("*", end="") # Print '*' to the console without newline
|
||||
print()
|
||||
|
||||
# Example usage
|
||||
myFunction(5)
|
||||
```
|
||||
|
||||
steps behind analysis
|
||||
|
||||
n = 5 => 5+10+15+20 => 5(1+2+3+4) ~ 5! # actual 5! - 5
|
||||
n = 4 => 4+8+16 => 4(1+2+3) ~ 4! # actual 4! - 4
|
||||
n = 3 => 3 => 3(1) ~ 3! # actual 3! - 3
|
||||
|
||||
so worse case scenario is O(n + n^2 + 1 + n!)
|
||||
|
||||
=> O(n!)
|
BIN
T11/ans/o_1.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/o_1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/o_log_n.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/o_log_n.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
T11/ans/o_n_square.png
(Stored with Git LFS)
Normal file
BIN
T11/ans/o_n_square.png
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user