From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- files/fr/tools/performance/examples/index.html | 8 +++ .../sorting_algorithms_comparison/index.html | 71 ++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 files/fr/tools/performance/examples/index.html create mode 100644 files/fr/tools/performance/examples/sorting_algorithms_comparison/index.html (limited to 'files/fr/tools/performance/examples') diff --git a/files/fr/tools/performance/examples/index.html b/files/fr/tools/performance/examples/index.html new file mode 100644 index 0000000000..e3ca28d9bd --- /dev/null +++ b/files/fr/tools/performance/examples/index.html @@ -0,0 +1,8 @@ +--- +title: Exemples +slug: Outils/Performance/Examples +translation_of: Tools/Performance/Examples +--- +
{{ToolsSidebar}}

Liste des pages de démos pour les scénarios de performances et walkthroughs.

+ +

{{ ListSubpages ("/en-US/docs/Tools/Performance/Examples", 5) }}

diff --git a/files/fr/tools/performance/examples/sorting_algorithms_comparison/index.html b/files/fr/tools/performance/examples/sorting_algorithms_comparison/index.html new file mode 100644 index 0000000000..608691a9d5 --- /dev/null +++ b/files/fr/tools/performance/examples/sorting_algorithms_comparison/index.html @@ -0,0 +1,71 @@ +--- +title: Comparaison des algorithmes de tri +slug: Outils/Performance/Examples/Sorting_algorithms_comparison +translation_of: Tools/Performance/Examples/Sorting_algorithms_comparison +--- +
{{ToolsSidebar}}

Ce articlé décrit un programe simple qui est utilisé dans deux des guides de l'outil Performance : le guide pour l'arbre d'appel et le guide pour le diagramme de flamme.

+ +

Ce programme compare les performances de trois algorithmes de tri différents :

+ + + +

Ce programme est composé des fonctions suivantes :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sortAll()Fonction principale. génère itérativement (200 itérations) des tableaux aléatoires et appellesort().
sort()Appelle les fonctions bubbleSort(), selectionSort(), et quickSort() tour à tour et affiche le résultat.
bubbleSort()Implémente un tri à bulles, retourne le tableau trié
selectionSort()Implémente un par sélection retourne le tableau trié
quickSort()Implémente un tri rapide, retourne le tableau trié
swap()fonction d'aide pour bubbleSort() et selectionSort().
partition()fonction d'aide pour quickSort().
+ +

le graphique d'appel ressemble à ceci :

+ +
sortAll()                     // (génère un tableau aléatoire puis appelle sort) x 200
+
+    -> sort()                 // tri le tableau avec chaque tri et affiche le résultat
+
+        -> bubbleSort()
+
+            -> swap()
+
+        -> selectionSort()
+
+            -> swap()
+
+        -> quickSort()
+
+            -> partition()
+ +

Les implémentations des algorithmes de tri dans ce programme ont été tirées du dépôt https://github.com/nzakas/computer-science-in-javascript/ et sont utilisées sous la licence MIT.

+ +

Vous pouvez tester ce programme d'exemple ici et cloner le code ici (soyez sûr de bien check out la branche gh-pages).

-- cgit v1.2.3-54-g00ecf