58 lines
1.8 KiB
Plaintext
58 lines
1.8 KiB
Plaintext
![]() |
AISSI JUDE-CHRIST BUT3
|
|||
|
|
|||
|
EXERCICE 2
|
|||
|
|
|||
|
PROFILING
|
|||
|
|
|||
|
Après l'exécution des commandes :
|
|||
|
- gcc -g -pg racinecarree.c
|
|||
|
- gprof ./a.out
|
|||
|
|
|||
|
|
|||
|
Nous avons comme résultat :
|
|||
|
|
|||
|
Flat profile:
|
|||
|
Each sample counts as 0.01 seconds.
|
|||
|
% cumulative self self total
|
|||
|
time seconds seconds calls ms/call ms/call name
|
|||
|
100.23 0.03 0.03 10000 0.00 0.00 racineCarree
|
|||
|
0.00 0.03 0.00 2 0.00 0.00 afficherTableau
|
|||
|
0.00 0.03 0.00 1 0.00 30.07 racineCarreeTab
|
|||
|
|
|||
|
|
|||
|
granularity: each sample hit covers 2 byte(s) for 33.26% of 0.03 seconds
|
|||
|
|
|||
|
index % time self children called name
|
|||
|
0.03 0.00 10000/10000 racineCarreeTab [2]
|
|||
|
[1] 100.0 0.03 0.00 10000 racineCarree [1]
|
|||
|
-----------------------------------------------
|
|||
|
0.00 0.03 1/1 main [3]
|
|||
|
[2] 100.0 0.00 0.03 1 racineCarreeTab [2]
|
|||
|
0.03 0.00 10000/10000 racineCarree [1]
|
|||
|
-----------------------------------------------
|
|||
|
<spontaneous>
|
|||
|
[3] 100.0 0.00 0.03 main [3]
|
|||
|
0.00 0.03 1/1 racineCarreeTab [2]
|
|||
|
0.00 0.00 2/2 afficherTableau [4]
|
|||
|
-----------------------------------------------
|
|||
|
0.00 0.00 2/2 main [3]
|
|||
|
[4] 0.0 0.00 0.00 2 afficherTableau [4]
|
|||
|
-----------------------------------------------
|
|||
|
|
|||
|
|
|||
|
COMPLEXITÉS
|
|||
|
|
|||
|
Complexité Cyclomatique :
|
|||
|
racineCarree() = 6
|
|||
|
racineCarreeTab() = 2
|
|||
|
|
|||
|
Complexité Algorithmique:
|
|||
|
racineCarree() = O(n)
|
|||
|
racineCarreeTab() = O(t × m)
|
|||
|
|
|||
|
|
|||
|
Exercice 4
|
|||
|
|
|||
|
Complexité cyclomatique :
|
|||
|
|
|||
|
trispecial() = 6
|