Skip to content

Commit 8e827f9

Browse files
committed
Commit
1 parent 9287e72 commit 8e827f9

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

Desarrollo/17_ComplejidadAlgoritmica.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ def factorial_recursive(n):
1919

2020

2121
if __name__ == '__main__':
22-
n = 2500
22+
n = 200000
2323
sys.setrecursionlimit(n + 10)
2424

25-
startingTime = time.time()
25+
comienzo = time.time()
2626
factorial(n)
27-
endTime = time.time()
28-
print(f"Execturion time with bucle\t{endTime - startingTime}")
27+
final = time.time()
28+
print(f"Execturion time with bucle\t{final - comienzo}")
2929

30-
startingTime = time.time()
30+
comienzo = time.time()
3131
factorial_recursive(n)
32-
endTime = time.time()
33-
print(f"Execution time with recusive\t{endTime - startingTime}")
32+
final = time.time()
33+
print(f"Execution time with recusive\t{final - comienzo}")

Desarrollo/19_Loop.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def f(x):
2+
respuesta = 0
3+
4+
for i in range(1000):
5+
respuesta += 1
6+
7+
for i in range(x):
8+
respuesta += 1
9+
10+
for i in range(x):
11+
for j in range(x):
12+
respuesta += 1
13+
respuesta += 1
14+
15+
return respuesta

0 commit comments

Comments
 (0)