Structures de Données et Algorithmes Examen 1 Flashcards

1
Q

T(N) :

A

(déf: le côut d’un algorithme)
- ça represente le temps d’execution d’un “run” quelconque

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

terme dominant :

A

une terme est dite dominant si, pour N suffisemment grand, il explique la fonction T(N)

ex:

aN^3 + log(N)

aN^3 est le terme dominant car, à N = 999999999999999, log(N) est négligable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Pourquoi on spécifie “pour N suffisemment grand” explique avec l’exemple N^2 vs 2N

A

N^2 = 1, 4, 9
2N = 2, 4, 6

si N < 2 2N est supérieur
si N > 2, N^2 est supérieur

so c’est important de spécifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

O(N) :

A

Pire cas d’un algorithme en terme de temps d’execution.
(Maximum execution time for a given algorithm)
(Upper bound)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

λ(N)

A

meilleurcas d’un algorithme en terme de temps d’execution.
(Minimum execution time for a given algorithm)
(Lower bound)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

f(N) = N^2
g(N) = N^3

O() = ?

A

O(N) = O(max( f(N) , g(N)) )
donc,
O(N) = O(max( N^2 , N^3) )

O(N) = O(N^3) ou O(g(N))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

f(N) = N^2
g(N) = N

O() = ?

A

O() = O(max( f(N) , g(N)) )
donc,
O() = O(max( N^2 , N) )

O() = O(N^2) ou O(f(N))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

boucle O( g(N) )
{
bloc O( f(N) )
}

O() = ?

A

O( f(N) ⋅ g(N) )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

boucle O( a(N) )
{
bloc O( b(N) )

bloc O( c(N) ) }

O() = ?

A

O( a(N) ) ⋅ O( max( b(N) , c(N) ) )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ϴ(N) :

A

si O( f(N) ) et λ( f(N) ) ont la même ordre. On le désigne, ϴ(N).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

sum of i :

A

n(n + 1)
_______

   2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly