{"id":88,"date":"2022-01-25T11:16:41","date_gmt":"2022-01-25T10:16:41","guid":{"rendered":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/?p=88"},"modified":"2022-01-25T11:16:41","modified_gmt":"2022-01-25T10:16:41","slug":"quelques-algorithmes-simples-%e2%98%9e%ef%be%9f%e3%83%ae%ef%be%9f%e2%98%9e","status":"publish","type":"post","link":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/2022\/01\/25\/quelques-algorithmes-simples-%e2%98%9e%ef%be%9f%e3%83%ae%ef%be%9f%e2%98%9e\/","title":{"rendered":"Quelques algorithmes simples (\u261e\uff9f\u30ee\uff9f)\u261e"},"content":{"rendered":"\n<h1 class=\"has-text-align-center\"><span class=\"has-inline-color has-vivid-purple-color\">1) Qu&#8217;est-ce qu&#8217;un algorithmes ?<\/span><\/h1>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\"><strong>C&#8217;est une<\/strong><\/span><strong><span class=\"has-inline-color has-light-green-cyan-color\"> suite d&#8217;op\u00e9rations \u00e0 ex\u00e9cuter pour r\u00e9soudre un probl\u00e8me (ou une classe de probl\u00e8me).<\/span><\/strong><\/h2>\n\n\n\n<h2><p><span class=\"has-inline-color has-light-green-cyan-color\">Propri\u00e9t<\/span><span style=\"font-size: revert\">\u00e9s attendues d&#8217;un algorithme : <strong>&#8211; Qu&#8217;il se termine<\/strong><\/span><\/p><span class=\"has-inline-color has-light-green-cyan-color\"><strong>                                                                   &#8211; Qu&#8217;il soit pertinent et efficace<\/strong><\/span><\/h2>\n\n\n\n<h1 class=\"has-text-align-center\"><span class=\"has-inline-color has-vivid-purple-color\">2) Tri par insertion ,par s\u00e9lection<\/span><\/h1>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\">Tri par insertion :<\/span><strong><span class=\"has-inline-color has-light-green-cyan-color\"> l&#8217;ordinateur va s\u00e9lectionner un 1er nombre et le compar\u00e9 a celui d&#8217;\u00e0 c\u00f4t\u00e9 (de la droite vers la gauche) jusqu&#8217;\u00e0 ce que le chiffre de gauche soit plus petit et il va le d\u00e9placer, s&#8217;ins\u00e9rer juste devant le nombre plus petit (voir photo ci-dessous). il r\u00e9p\u00e9tera ce processus jusqu&#8217;\u00e0 ce que tout les chiffres soit dans l&#8217;ordre croissant, trier.<\/span><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"964\" height=\"216\" src=\"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image.png\" alt=\"\" class=\"wp-image-89\" srcset=\"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image.png 964w, http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-300x67.png 300w, http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-768x172.png 768w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/><\/figure>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\">Tri par s\u00e9lection : <strong>l&#8217;ordinateur va prendre le premier nombre (\u00e0 gauche) puis le comparer \u00e0 tous les autres jusqu&#8217;\u00e0 trouver le plus petit. Il les inversera ensuite, il r\u00e9p\u00e9tera cet op\u00e9ration jusqu&#8217;\u00e0 ce que les nombres soit dans l&#8217;ordre croissant, trier.<\/strong><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"969\" height=\"212\" src=\"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-1.png\" alt=\"\" class=\"wp-image-90\" srcset=\"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-1.png 969w, http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-1-300x66.png 300w, http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-content\/uploads\/sites\/13\/2022\/01\/image-1-768x168.png 768w\" sizes=\"(max-width: 969px) 100vw, 969px\" \/><\/figure>\n\n\n\n<h1 class=\"has-text-align-center\"><span class=\"has-inline-color has-vivid-purple-color\">3) Efficacit\u00e9 des tris<\/span><\/h1>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\">Le code du tri par insertion : <\/span><\/h2>\n\n\n\n<ol><li><span class=\"has-inline-color has-black-color\"><strong>PROCEDURE<\/strong>\u00a0tri_Insertion\u00a0(\u00a0Tableau a[1:n])<\/span><\/li><li><span class=\"has-inline-color has-black-color\">\u00a0 \u00a0\u00a0<strong>POUR<\/strong>\u00a0i\u00a0<strong>VARIANT DE<\/strong>\u00a02\u00a0<strong>A<\/strong>\u00a0n\u00a0<strong>FAIRE<\/strong><\/span><\/li><li><span class=\"has-inline-color has-black-color\">\u00a0 \u00a0 \u00a0 \u00a0 INSERER a[i]\u00a0\u00e0 sa place dans a[1:i-1];<\/span><\/li><li><span class=\"has-inline-color has-black-color\"><strong>FIN PROCEDURE<\/strong>;<\/span><\/li><\/ol>\n\n\n\n<h2><strong><span class=\"has-inline-color has-light-green-cyan-color\">J<\/span><\/strong><span class=\"has-inline-color has-light-green-cyan-color\"><strong>e trouve que c&#8217;est la m\u00e9thode de tri la plus rapide et efficace et son code est plus facile \u00e0 comprendre.<\/strong><\/span><\/h2>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\">Le code du tri par s\u00e9lection :<\/span><\/h2>\n\n\n\n<ol><li><strong>PROCEDURE<\/strong>&nbsp;tri_Selection&nbsp;(&nbsp;Tableau a[1:n])<\/li><li>&nbsp; &nbsp;&nbsp;<strong>POUR<\/strong>&nbsp;i&nbsp;<strong>VARIANT DE<\/strong>&nbsp;1&nbsp;<strong>A<\/strong>&nbsp;n&nbsp;&#8211;&nbsp;1&nbsp;<strong>FAIRE<\/strong><\/li><li>&nbsp; &nbsp; &nbsp; &nbsp; TROUVER&nbsp;[j]&nbsp;LE PLUS PETIT ELEMENT DE&nbsp;[i&nbsp;+&nbsp;1:n];<\/li><li>&nbsp; &nbsp; &nbsp; &nbsp; ECHANGER&nbsp;[j]&nbsp;ET&nbsp;[i];<\/li><li><strong>FIN PROCEDURE<\/strong>;<\/li><\/ol>\n\n\n\n<h2><span class=\"has-inline-color has-light-green-cyan-color\"><strong>Je trouve que cet m\u00e9thode de tri n&#8217;est pas tr\u00e8s efficace et elle est illogique. De plus son code est plus complexe que celui du tri par insertion.<\/strong><\/span><\/h2>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) Qu&#8217;est-ce qu&#8217;un algorithmes ? C&#8217;est une suite d&#8217;op\u00e9rations \u00e0 ex\u00e9cuter pour r\u00e9soudre un probl\u00e8me (ou une classe de probl\u00e8me). Propri\u00e9t\u00e9s attendues d&#8217;un algorithme : &#8211; Qu&#8217;il se termine &#8211; Qu&#8217;il soit pertinent et efficace 2) Tri par insertion ,par s\u00e9lection Tri par insertion : l&#8217;ordinateur va s\u00e9lectionner un 1er nombre et le compar\u00e9 a [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/posts\/88"}],"collection":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":2,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":92,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/posts\/88\/revisions\/92"}],"wp:attachment":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/romain\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}