function mergeSort(var a : array of integer; minIndex, maxIndex : integer); {Pre: a defined maxIndex>=minIndex; minIndex>=0; a[minIndex..maxIndex] defined Post: for each i into minIndex..maxIndex, a[maxIndex] >= a[i] } var center : integer; {center of the array} begin if minIndex > maxIndex {O(1)} then begin center := (minIndex + maxIndex) div 2; {O(1)} mergeSort(a, minIndex, center); {T(n/2)} mergeSort(a, center+1, maxIndex); {T(n/2)} merge(a, minIndex, center, maxIndex); {O(n)} end end;
Merge Sort Exemple de tri par fusion
Selection Sort Exemple de tri par sélection
Suite de Fibonacci Exemple de récursion en Pascal
Suite de Fibonacci Exemple de méoïsation en Pascal
Tous les extraits
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
9 mots clés dont 5 définis manuellement (plus d'information...).
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)