Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
1 result

Target

Select target project
  • rvuillem/inf-tc1
  • hwei/inf-tc1
  • nmbengue/inf-tc1
  • fernanda/inf-tc1
  • mleger/inf-tc1
  • lmeng/inf-tc1
  • gferryla/inf-tc1
  • jconso/inf-tc1
  • smaghsou/inf-tc1
  • emarquet/inf-tc1
  • ecluzel/inf-tc1
  • aaudeoud/inf-tc1
  • tsegond/inf-tc1
  • aetienne/inf-tc1
  • djoly/inf-tc1
  • bcampeas/inf-tc1
  • dnovarez/inf-tc1
  • ruetm/inf-tc1
  • cchenu/inf-tc1
  • cguiotdu/inf-tc1
  • mclouard/inf-tc1
  • gwachowi/inf-tc1
  • qbaalaou/inf-tc1
  • sbrocas/inf-tc1
  • ppupion/inf-tc1
  • kinty/inf-tc1
  • hadomo/inf-tc1
  • tgicquel/inf-tc1
  • rhahn/inf-tc1
  • cguyau/inf-tc1
  • mpairaul/inf-tc1
  • rmuller/inf-tc1
  • rlecharp/inf-tc1
  • asebasty/inf-tc1
  • qmaler/inf-tc1
  • aoussaid/inf-tc1
  • kcherigu/inf-tc1
  • sgu/inf-tc1
  • malcalat/inf-tc1
  • afalourd/inf-tc1
  • phugues/inf-tc1
  • lsteunou/inf-tc1
  • llauschk/inf-tc1
  • langloia/inf-tc1
  • aboucard/inf-tc1
  • wmellali/inf-tc1
  • ifaraidi/inf-tc1
  • lir/inf-tc1
  • ynedjar/inf-tc1
  • schneidl/inf-tc1
  • zprandi/inf-tc1
  • acoradid/inf-tc1
  • amarcq/inf-tc1
  • dcombet/inf-tc1
  • gplaud/inf-tc1
  • mkernoaj/inf-tc1
  • gbichot/inf-tc1
  • tdutille/inf-tc1
58 results
Select Git revision
  • master
1 result
Show changes
Showing
with 2771 additions and 0 deletions
TD07/monnaie-progdyn.png

67.4 KiB

This diff is collapsed.
TD07bis/monnaie-graph.png

69.5 KiB

TD07bis/monnaie-progdyn.png

67.4 KiB

File added
File added
File added
File added
File added
File added
%% Cell type:markdown id:82b57c5e tags:
%% Cell type:markdown id:e8a19c58 tags:
# INF TC1 - Algorithmes et structures de données
## Exercices
%% Cell type:markdown id:2968208d tags:
---
%% Cell type:markdown id:a4e4fad3 tags:
# Data Structures and Complexity
%% Cell type:markdown id:a8adef9b tags:
---
%% Cell type:markdown id:827ebb43-1e5d-4756-83ba-97af3e36b6af tags:
_For the following question, if a complexity is needed please pick one in this list_
%% Cell type:code id:b54157fc-f0d5-4689-bf2b-344a608bc5a9 tags:
``` python
list_complexities = ["O(1)", "O(log(n))", "O(n)", "O(n^2)", "O(nlog(n))", "O(n^3)", "O(2^n)", "O(n!)", "O(n^n)"]
```
%% Cell type:markdown id:568202fd tags:
### Exercise 1: Identify the complexity
%% Cell type:code id:431fe8c1-91d1-40f3-a7a4-f4a3770a4a01 tags:
``` python
def nested_loop_example(arr):
n = len(arr)
for i in range(n):
for j in range(n):
print(arr[i] + arr[j])
```
%% Cell type:code id:e68b3e9a-418f-4950-9f27-18bb0fe90794 tags:
``` python
# nested_loop_example_complexity = ?
# YOUR CODE HERE
raise NotImplementedError()
```
%% Cell type:markdown id:612dc873-419b-42c5-be36-0accd03ffa79 tags:
### Exercise 2: Identify the complexity
%% Cell type:code id:76102853-e1f3-4717-8a59-1091195a19eb tags:
``` python
def fibonacci_recursive(n):
if n <= 1:
return n
return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2)
```
%% Cell type:code id:dead6a52-7996-4eae-9d2a-f75d5d26bbb7 tags:
``` python
# fibonacci_recursive_complexity = ?
# YOUR CODE HERE
raise NotImplementedError()
```
%% Cell type:markdown id:aa4a6ce7-e542-4b23-8a10-ca0bf93de041 tags:
### Exercise 3: Identify the complexity
%% Cell type:code id:70af3e43-8053-49c9-ba58-346a3e915bdb tags:
``` python
def binary_search(arr, target):
low, high = 0, len(arr) - 1
while low <= high:
mid = (low + high) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
low = mid + 1
else:
high = mid - 1
return -1
```
%% Cell type:code id:9c22866c-b4fc-4228-b0ab-5882d964f5f6 tags:
``` python
# binary_searche_complexity = ?
# YOUR CODE HERE
raise NotImplementedError()
```
%% Cell type:markdown id:87b4921b-ef55-4083-b4f1-a3ca5bb7b011 tags:
### Additional checks (do not change)
%% Cell type:code id:6e8f2878-ce5f-4cd8-a5a5-7bce8f655ab8 tags:
``` python
assert nested_loop_example_complexity in list_complexities
assert fibonacci_recursive_complexity in list_complexities
assert binary_searche_complexity in list_complexities
```
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File added
File added
File added
File added
File added
File added