{"id":2799,"date":"2025-04-28T11:20:11","date_gmt":"2025-04-28T09:20:11","guid":{"rendered":"https:\/\/labodemaths.fr\/WordPress3\/?p=2799"},"modified":"2025-04-28T11:53:36","modified_gmt":"2025-04-28T09:53:36","slug":"nsi-tri-par-selection-2","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/nsi-tri-par-selection-2\/","title":{"rendered":"NSI, tri par selection"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>a=&#91;1,12,5,8,2,9,14,3]\ndef tri_selection(liste):\n    for i in range(len(liste)-1):\n        i_min=i\n        for j in range(i, len(liste)):\n            if liste&#91;j]&lt;liste&#91;i_min]:\n                i_min=j\n        liste&#91;i],liste&#91;i_min]=liste&#91;i_min], liste&#91;i]     \n    return liste\n\ndef liste_aleatoire(n):\n    return &#91;random.randint(0,n) for i in range(n)]\n    \ndef est_triee(liste):\n    '''\n    retourne si une liste est tri\u00e9e\n    &gt;&gt;&gt;est_triee(&#91;1,2,8,3])\n    False\n    &gt;&gt;&gt;est_triee(&#91;1,2,3,3,8])\n    True\n    '''\n    \n\n    \n    \n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2799"}],"collection":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/comments?post=2799"}],"version-history":[{"count":4,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2799\/revisions"}],"predecessor-version":[{"id":2803,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/2799\/revisions\/2803"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=2799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=2799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=2799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}