CINXE.COM

Řazení výběrem – Wikipedie

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="cs" dir="ltr"> <head> <meta charset="UTF-8"> <title>Řazení výběrem – Wikipedie</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )cswikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"ČSN basic dt","wgMonthNames":["","leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],"wgRequestId":"2b7ba5a6-10b6-45e4-8b0a-bf46f508beb3","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Řazení_výběrem","wgTitle":"Řazení výběrem","wgCurRevisionId":21314095,"wgRevisionId":21314095,"wgArticleId":114054,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Monitoring:Autoritní kontrola s 0 identifikátory","Řadicí algoritmy"],"wgPageViewLanguage":"cs","wgPageContentLanguage":"cs","wgPageContentModel":"wikitext","wgRelevantPageName":"Řazení_výběrem","wgRelevantArticleId":114054,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick": true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"cs","pageLanguageDir":"ltr","pageVariantFallbacks":"cs"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":3000,"wgRelatedArticlesCompat":[],"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q220831","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":true,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user": "ready","user.options":"loading","ext.math.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.WikiMiniAtlas","ext.gadget.OSMmapa","ext.gadget.direct-links-to-commons","ext.gadget.ReferenceTooltips","ext.gadget.courses","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns", "ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=cs&amp;modules=ext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=cs&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=cs&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/b/b0/Selection_sort_animation.gif"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="1200"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/b/b0/Selection_sort_animation.gif"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="800"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="640"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Řazení výběrem – Wikipedie"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//cs.m.wikipedia.org/wiki/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem"> <link rel="alternate" type="application/x-wiki" title="Editovat" href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedie (cs)"> <link rel="EditURI" type="application/rsd+xml" href="//cs.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://cs.wikipedia.org/wiki/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.cs"> <link rel="alternate" type="application/atom+xml" title="Atom kanál Wikipedie." href="/w/index.php?title=Speci%C3%A1ln%C3%AD:Posledn%C3%AD_zm%C4%9Bny&amp;feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Řazení_výběrem rootpage-Řazení_výběrem skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Přeskočit na obsah</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Projekt"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Hlavní menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Hlavní menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Hlavní menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">přesunout do postranního panelu</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">skrýt</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigace </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage" class="mw-list-item"><a href="/wiki/Hlavn%C3%AD_strana" title="Navštívit Hlavní stranu [z]" accesskey="z"><span>Hlavní strana</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/N%C3%A1pov%C4%9Bda:Obsah" title="Místo, kde najdete pomoc"><span>Nápověda</span></a></li><li id="n-helpdesk" class="mw-list-item"><a href="/wiki/Wikipedie:Pot%C5%99ebuji_pomoc" title="Pokud si nevíte rady, zeptejte se ostatních"><span>Potřebuji pomoc</span></a></li><li id="n-featuredcontent" class="mw-list-item"><a href="/wiki/Wikipedie:Nejlep%C5%A1%C3%AD_%C4%8Dl%C3%A1nky" title="Přehled článků, které jsou považovány za nejlepší na české Wikipedii"><span>Nejlepší články</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:N%C3%A1hodn%C3%A1_str%C3%A1nka" title="Přejít na náhodně vybranou stránku [x]" accesskey="x"><span>Náhodný článek</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Posledn%C3%AD_zm%C4%9Bny" title="Seznam posledních změn na této wiki [r]" accesskey="r"><span>Poslední změny</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedie:Port%C3%A1l_Wikipedie" title="O projektu, jak můžete pomoci, kde hledat"><span>Komunitní portál</span></a></li><li id="n-villagepump" class="mw-list-item"><a href="/wiki/Wikipedie:Pod_l%C3%ADpou" title="Hlavní diskusní fórum"><span>Pod lípou</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Hlavn%C3%AD_strana" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedie" src="/static/images/mobile/copyright/wikipedia-wordmark-cs.svg" style="width: 7.5em; height: 1.1875em;"> <img class="mw-logo-tagline" alt="Wikipedie: Otevřená encyklopedie" src="/static/images/mobile/copyright/wikipedia-tagline-cs.svg" width="118" height="13" style="width: 7.375em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Speci%C3%A1ln%C3%AD:Hled%C3%A1n%C3%AD" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Prohledat tuto wiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Hledání</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Hledat na Wikipedii" aria-label="Hledat na Wikipedii" autocapitalize="sentences" title="Prohledat tuto wiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Speciální:Hledání"> </div> <button class="cdx-button cdx-search-input__end-button">Hledat</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Osobní nástroje"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Vzhled"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Změnit vzhled velikosti písma, šířky stránky a barvy" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Vzhled" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Vzhled</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_cs.wikipedia.org&amp;uselang=cs" class=""><span>Podpořte Wikipedii</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Speci%C3%A1ln%C3%AD:Vytvo%C5%99it_%C3%BA%C4%8Det&amp;returnto=%C5%98azen%C3%AD+v%C3%BDb%C4%9Brem" title="Doporučujeme vytvořit si účet a přihlásit se, ovšem není to povinné" class=""><span>Vytvoření účtu</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Speci%C3%A1ln%C3%AD:P%C5%99ihl%C3%A1sit&amp;returnto=%C5%98azen%C3%AD+v%C3%BDb%C4%9Brem" title="Doporučujeme vám přihlásit se, ovšem není to povinné. [o]" accesskey="o" class=""><span>Přihlášení</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Další možnosti" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Osobní nástroje" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Osobní nástroje</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Uživatelské menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_cs.wikipedia.org&amp;uselang=cs"><span>Podpořte Wikipedii</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:Vytvo%C5%99it_%C3%BA%C4%8Det&amp;returnto=%C5%98azen%C3%AD+v%C3%BDb%C4%9Brem" title="Doporučujeme vytvořit si účet a přihlásit se, ovšem není to povinné"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Vytvoření účtu</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:P%C5%99ihl%C3%A1sit&amp;returnto=%C5%98azen%C3%AD+v%C3%BDb%C4%9Brem" title="Doporučujeme vám přihlásit se, ovšem není to povinné. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Přihlášení</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Stránky pro odhlášené editory <a href="/wiki/N%C3%A1pov%C4%9Bda:%C3%9Avod" aria-label="Více informací o editování"><span>dozvědět se více</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Moje_p%C5%99%C3%ADsp%C4%9Bvky" title="Seznam editací provedených z této IP adresy [y]" accesskey="y"><span>Příspěvky</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Moje_diskuse" title="Diskuse o editacích provedených z této IP adresy [n]" accesskey="n"><span>Diskuse</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Projekt"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Obsah" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Obsah</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">přesunout do postranního panelu</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">skrýt</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">(úvod)</div> </a> </li> <li id="toc-Princip" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Princip"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Princip</span> </div> </a> <ul id="toc-Princip-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Nestabilita_řazení" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Nestabilita_řazení"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Nestabilita řazení</span> </div> </a> <ul id="toc-Nestabilita_řazení-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Implementace_algoritmu" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Implementace_algoritmu"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Implementace algoritmu</span> </div> </a> <ul id="toc-Implementace_algoritmu-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Externí_odkazy" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Externí_odkazy"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Externí odkazy</span> </div> </a> <ul id="toc-Externí_odkazy-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Obsah" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Přepnout obsah" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Přepnout obsah</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Řazení výběrem</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Přejděte k článku v jiném jazyce. Je dostupný v 41 jazycích" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-41" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">41 jazyků</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D8%AA%D8%B1%D8%AA%D9%8A%D8%A8_%D8%A7%D9%86%D8%AA%D9%82%D8%A7%D8%A6%D9%8A" title="ترتيب انتقائي – arabština" lang="ar" hreflang="ar" data-title="ترتيب انتقائي" data-language-autonym="العربية" data-language-local-name="arabština" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/Se%C3%A7m%C9%99li_%C3%A7e%C5%9Fidl%C9%99m%C9%99" title="Seçməli çeşidləmə – ázerbájdžánština" lang="az" hreflang="az" data-title="Seçməli çeşidləmə" data-language-autonym="Azərbaycanca" data-language-local-name="ázerbájdžánština" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/%D0%A1%D0%BE%D1%80%D1%82%D0%B8%D1%80%D0%B0%D0%BD%D0%B5_%D1%87%D1%80%D0%B5%D0%B7_%D0%BF%D1%80%D1%8F%D0%BA%D0%B0_%D1%81%D0%B5%D0%BB%D0%B5%D0%BA%D1%86%D0%B8%D1%8F" title="Сортиране чрез пряка селекция – bulharština" lang="bg" hreflang="bg" data-title="Сортиране чрез пряка селекция" data-language-autonym="Български" data-language-local-name="bulharština" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-bh mw-list-item"><a href="https://bh.wikipedia.org/wiki/%E0%A4%9A%E0%A5%81%E0%A4%A8%E0%A4%BE%E0%A4%B5_%E0%A4%9B%E0%A4%81%E0%A4%9F%E0%A4%BE%E0%A4%88" title="चुनाव छँटाई – Bhojpuri" lang="bh" hreflang="bh" data-title="चुनाव छँटाई" data-language-autonym="भोजपुरी" data-language-local-name="Bhojpuri" class="interlanguage-link-target"><span>भोजपुरी</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Udtagelsessortering" title="Udtagelsessortering – dánština" lang="da" hreflang="da" data-title="Udtagelsessortering" data-language-autonym="Dansk" data-language-local-name="dánština" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Selectionsort" title="Selectionsort – němčina" lang="de" hreflang="de" data-title="Selectionsort" data-language-autonym="Deutsch" data-language-local-name="němčina" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/%CE%A4%CE%B1%CE%BE%CE%B9%CE%BD%CF%8C%CE%BC%CE%B7%CF%83%CE%B7_%CE%BC%CE%B5_%CE%B5%CF%80%CE%B9%CE%BB%CE%BF%CE%B3%CE%AE" title="Ταξινόμηση με επιλογή – řečtina" lang="el" hreflang="el" data-title="Ταξινόμηση με επιλογή" data-language-autonym="Ελληνικά" data-language-local-name="řečtina" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Selection_sort" title="Selection sort – angličtina" lang="en" hreflang="en" data-title="Selection sort" data-language-autonym="English" data-language-local-name="angličtina" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Ordenamiento_por_selecci%C3%B3n" title="Ordenamiento por selección – španělština" lang="es" hreflang="es" data-title="Ordenamiento por selección" data-language-autonym="Español" data-language-local-name="španělština" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/Valiksortimine" title="Valiksortimine – estonština" lang="et" hreflang="et" data-title="Valiksortimine" data-language-autonym="Eesti" data-language-local-name="estonština" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D9%85%D8%B1%D8%AA%D8%A8%E2%80%8C%D8%B3%D8%A7%D8%B2%DB%8C_%D8%A7%D9%86%D8%AA%D8%AE%D8%A7%D8%A8%DB%8C" title="مرتب‌سازی انتخابی – perština" lang="fa" hreflang="fa" data-title="مرتب‌سازی انتخابی" data-language-autonym="فارسی" data-language-local-name="perština" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Valintalajittelu" title="Valintalajittelu – finština" lang="fi" hreflang="fi" data-title="Valintalajittelu" data-language-autonym="Suomi" data-language-local-name="finština" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Tri_par_s%C3%A9lection" title="Tri par sélection – francouzština" lang="fr" hreflang="fr" data-title="Tri par sélection" data-language-autonym="Français" data-language-local-name="francouzština" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%9E%D7%99%D7%95%D7%9F_%D7%91%D7%97%D7%99%D7%A8%D7%94" title="מיון בחירה – hebrejština" lang="he" hreflang="he" data-title="מיון בחירה" data-language-autonym="עברית" data-language-local-name="hebrejština" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikipedia.org/wiki/%E0%A4%9A%E0%A4%AF%E0%A4%A8_%E0%A4%9B%E0%A4%BE%E0%A4%82%E0%A4%9F%E0%A4%A8%E0%A4%BE" title="चयन छांटना – hindština" lang="hi" hreflang="hi" data-title="चयन छांटना" data-language-autonym="हिन्दी" data-language-local-name="hindština" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/Kiv%C3%A1laszt%C3%A1sos_rendez%C3%A9s" title="Kiválasztásos rendezés – maďarština" lang="hu" hreflang="hu" data-title="Kiválasztásos rendezés" data-language-autonym="Magyar" data-language-local-name="maďarština" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikipedia.org/wiki/%D4%B8%D5%B6%D5%BF%D6%80%D5%B8%D6%82%D5%A9%D5%B5%D5%A1%D5%B6_%D5%BF%D5%A5%D5%BD%D5%A1%D5%AF%D5%A1%D5%BE%D5%B8%D6%80%D5%B8%D6%82%D5%B4" title="Ընտրության տեսակավորում – arménština" lang="hy" hreflang="hy" data-title="Ընտրության տեսակավորում" data-language-autonym="Հայերեն" data-language-local-name="arménština" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Selection_sort" title="Selection sort – italština" lang="it" hreflang="it" data-title="Selection sort" data-language-autonym="Italiano" data-language-local-name="italština" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E9%81%B8%E6%8A%9E%E3%82%BD%E3%83%BC%E3%83%88" title="選択ソート – japonština" lang="ja" hreflang="ja" data-title="選択ソート" data-language-autonym="日本語" data-language-local-name="japonština" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-ka mw-list-item"><a href="https://ka.wikipedia.org/wiki/%E1%83%A8%E1%83%94%E1%83%A0%E1%83%A9%E1%83%94%E1%83%95%E1%83%98%E1%83%97%E1%83%98_%E1%83%A1%E1%83%9D%E1%83%A0%E1%83%A2%E1%83%98%E1%83%A0%E1%83%94%E1%83%91%E1%83%90" title="შერჩევითი სორტირება – gruzínština" lang="ka" hreflang="ka" data-title="შერჩევითი სორტირება" data-language-autonym="ქართული" data-language-local-name="gruzínština" class="interlanguage-link-target"><span>ქართული</span></a></li><li class="interlanguage-link interwiki-kk mw-list-item"><a href="https://kk.wikipedia.org/wiki/%D0%A2%D0%B0%D2%A3%D0%B4%D0%B0%D1%83_%D0%B0%D1%80%D2%9B%D1%8B%D0%BB%D1%8B_%D1%81%D2%B1%D1%80%D1%8B%D0%BF%D1%82%D0%B0%D1%83" title="Таңдау арқылы сұрыптау – kazaština" lang="kk" hreflang="kk" data-title="Таңдау арқылы сұрыптау" data-language-autonym="Қазақша" data-language-local-name="kazaština" class="interlanguage-link-target"><span>Қазақша</span></a></li><li class="interlanguage-link interwiki-kn mw-list-item"><a href="https://kn.wikipedia.org/wiki/%E0%B2%86%E0%B2%AF%E0%B3%8D%E0%B2%95%E0%B3%86%E0%B2%AF_%E0%B2%B5%E0%B2%BF%E0%B2%82%E0%B2%97%E0%B2%A1%E0%B2%A3%E0%B3%86_(%E0%B2%B8%E0%B3%86%E0%B2%B2%E0%B2%95%E0%B3%8D%E0%B2%B7%E0%B2%A8%E0%B3%8D_%E0%B2%B8%E0%B2%BE%E0%B2%B0%E0%B3%8D%E0%B2%9F%E0%B3%8D)" title="ಆಯ್ಕೆಯ ವಿಂಗಡಣೆ (ಸೆಲಕ್ಷನ್ ಸಾರ್ಟ್) – kannadština" lang="kn" hreflang="kn" data-title="ಆಯ್ಕೆಯ ವಿಂಗಡಣೆ (ಸೆಲಕ್ಷನ್ ಸಾರ್ಟ್)" data-language-autonym="ಕನ್ನಡ" data-language-local-name="kannadština" class="interlanguage-link-target"><span>ಕನ್ನಡ</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EC%84%A0%ED%83%9D_%EC%A0%95%EB%A0%AC" title="선택 정렬 – korejština" lang="ko" hreflang="ko" data-title="선택 정렬" data-language-autonym="한국어" data-language-local-name="korejština" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-lmo mw-list-item"><a href="https://lmo.wikipedia.org/wiki/Selection_Sort" title="Selection Sort – lombardština" lang="lmo" hreflang="lmo" data-title="Selection Sort" data-language-autonym="Lombard" data-language-local-name="lombardština" class="interlanguage-link-target"><span>Lombard</span></a></li><li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://lt.wikipedia.org/wiki/I%C5%A1rinkimo_rikiavimo_algoritmas" title="Išrinkimo rikiavimo algoritmas – litevština" lang="lt" hreflang="lt" data-title="Išrinkimo rikiavimo algoritmas" data-language-autonym="Lietuvių" data-language-local-name="litevština" class="interlanguage-link-target"><span>Lietuvių</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%B8%E0%B5%86%E0%B4%B2%E0%B4%95%E0%B5%8D%E0%B4%B7%E0%B5%BB_%E0%B4%B8%E0%B5%8B%E0%B5%BC%E0%B4%9F%E0%B5%8D%E0%B4%9F%E0%B5%8D" title="സെലക്ഷൻ സോർട്ട് – malajálamština" lang="ml" hreflang="ml" data-title="സെലക്ഷൻ സോർട്ട്" data-language-autonym="മലയാളം" data-language-local-name="malajálamština" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Selection_sort" title="Selection sort – nizozemština" lang="nl" hreflang="nl" data-title="Selection sort" data-language-autonym="Nederlands" data-language-local-name="nizozemština" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Sortowanie_przez_wybieranie" title="Sortowanie przez wybieranie – polština" lang="pl" hreflang="pl" data-title="Sortowanie przez wybieranie" data-language-autonym="Polski" data-language-local-name="polština" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Selection_sort" title="Selection sort – portugalština" lang="pt" hreflang="pt" data-title="Selection sort" data-language-autonym="Português" data-language-local-name="portugalština" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%A1%D0%BE%D1%80%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%B0_%D0%B2%D1%8B%D0%B1%D0%BE%D1%80%D0%BE%D0%BC" title="Сортировка выбором – ruština" lang="ru" hreflang="ru" data-title="Сортировка выбором" data-language-autonym="Русский" data-language-local-name="ruština" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Selection_sort" title="Selection sort – Simple English" lang="en-simple" hreflang="en-simple" data-title="Selection sort" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/Selection_sort" title="Selection sort – slovenština" lang="sk" hreflang="sk" data-title="Selection sort" data-language-autonym="Slovenčina" data-language-local-name="slovenština" class="interlanguage-link-target"><span>Slovenčina</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Urejanje_z_navadnim_izbiranjem" title="Urejanje z navadnim izbiranjem – slovinština" lang="sl" hreflang="sl" data-title="Urejanje z navadnim izbiranjem" data-language-autonym="Slovenščina" data-language-local-name="slovinština" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%A1%D0%BE%D1%80%D1%82%D0%B8%D1%80%D0%B0%D1%9A%D0%B5_%D1%81%D0%B5%D0%BB%D0%B5%D0%BA%D1%86%D0%B8%D1%98%D0%BE%D0%BC" title="Сортирање селекцијом – srbština" lang="sr" hreflang="sr" data-title="Сортирање селекцијом" data-language-autonym="Српски / srpski" data-language-local-name="srbština" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Urvalssortering" title="Urvalssortering – švédština" lang="sv" hreflang="sv" data-title="Urvalssortering" data-language-autonym="Svenska" data-language-local-name="švédština" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%87%E0%B8%A5%E0%B8%B3%E0%B8%94%E0%B8%B1%E0%B8%9A%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81" title="การเรียงลำดับแบบเลือก – thajština" lang="th" hreflang="th" data-title="การเรียงลำดับแบบเลือก" data-language-autonym="ไทย" data-language-local-name="thajština" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tl mw-list-item"><a href="https://tl.wikipedia.org/wiki/Selection_sort" title="Selection sort – tagalog" lang="tl" hreflang="tl" data-title="Selection sort" data-language-autonym="Tagalog" data-language-local-name="tagalog" class="interlanguage-link-target"><span>Tagalog</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/Se%C3%A7meli_s%C4%B1ralama" title="Seçmeli sıralama – turečtina" lang="tr" hreflang="tr" data-title="Seçmeli sıralama" data-language-autonym="Türkçe" data-language-local-name="turečtina" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%A1%D0%BE%D1%80%D1%82%D1%83%D0%B2%D0%B0%D0%BD%D0%BD%D1%8F_%D0%B2%D0%B8%D0%B1%D0%BE%D1%80%D0%BE%D0%BC" title="Сортування вибором – ukrajinština" lang="uk" hreflang="uk" data-title="Сортування вибором" data-language-autonym="Українська" data-language-local-name="ukrajinština" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/S%E1%BA%AFp_x%E1%BA%BFp_ch%E1%BB%8Dn" title="Sắp xếp chọn – vietnamština" lang="vi" hreflang="vi" data-title="Sắp xếp chọn" data-language-autonym="Tiếng Việt" data-language-local-name="vietnamština" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F" title="选择排序 – čínština" lang="zh" hreflang="zh" data-title="选择排序" data-language-autonym="中文" data-language-local-name="čínština" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q220831#sitelinks-wikipedia" title="Editovat mezijazykové odkazy" class="wbc-editpage">Upravit odkazy</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Jmenné prostory"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem" title="Zobrazit obsahovou stránku [c]" accesskey="c"><span>Článek</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Diskuse:%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit&amp;redlink=1" rel="discussion" class="new" title="Diskuse ke stránce (stránka neexistuje) [t]" accesskey="t"><span>Diskuse</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Změnit variantu jazyka" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">čeština</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Zobrazení"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem"><span>Číst</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit" title="Editovat tuto stránku [v]" accesskey="v"><span>Editovat</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit" title="Editovat zdrojový kód této stránky [e]" accesskey="e"><span>Editovat zdroj</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=history" title="Starší verze této stránky. [h]" accesskey="h"><span>Zobrazit historii</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Nástroje ke stránce"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Nástroje" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Nástroje</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Nástroje</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">přesunout do postranního panelu</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">skrýt</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Další možnosti" > <div class="vector-menu-heading"> Akce </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem"><span>Číst</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit" title="Editovat tuto stránku [v]" accesskey="v"><span>Editovat</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit" title="Editovat zdrojový kód této stránky [e]" accesskey="e"><span>Editovat zdroj</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=history"><span>Zobrazit historii</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Obecné </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Co_odkazuje_na/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem" title="Seznam všech wikistránek, které sem odkazují [j]" accesskey="j"><span>Odkazuje sem</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Souvisej%C3%ADc%C3%AD_zm%C4%9Bny/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem" rel="nofollow" title="Nedávné změny stránek, na které je odkazováno [k]" accesskey="k"><span>Související změny</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=cs" title="Nahrát obrázky či jiná multimédia [u]" accesskey="u"><span>Načíst soubor</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Speci%C3%A1ln%C3%AD:Speci%C3%A1ln%C3%AD_str%C3%A1nky" title="Seznam všech speciálních stránek [q]" accesskey="q"><span>Speciální stránky</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;oldid=21314095" title="Trvalý odkaz na současnou verzi této stránky"><span>Trvalý odkaz</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=info" title="Více informací o této stránce"><span>Informace o stránce</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:Citovat&amp;page=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;id=21314095&amp;wpFormIdentifier=titleform" title="Informace o tom, jak citovat tuto stránku"><span>Citovat stránku</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:UrlShortener&amp;url=https%3A%2F%2Fcs.wikipedia.org%2Fwiki%2F%25C5%2598azen%25C3%25AD_v%25C3%25BDb%25C4%259Brem"><span>Získat zkrácené URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:QrCode&amp;url=https%3A%2F%2Fcs.wikipedia.org%2Fwiki%2F%25C5%2598azen%25C3%25AD_v%25C3%25BDb%25C4%259Brem"><span>Stáhnout QR kód</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Tisk/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:Kniha&amp;bookcmd=book_creator&amp;referer=%C5%98azen%C3%AD+v%C3%BDb%C4%9Brem"><span>Vytvořit knihu</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Speci%C3%A1ln%C3%AD:DownloadAsPdf&amp;page=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=show-download-screen"><span>Stáhnout jako PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;printable=yes" title="Tato stránka v podobě vhodné k tisku [p]" accesskey="p"><span>Verze k tisku</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> Na jiných projektech </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:Selection_sort" hreflang="en"><span>Wikimedia Commons</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q220831" title="Odkaz na propojenou položku datového úložiště [g]" accesskey="g"><span>Položka Wikidat</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Nástroje ke stránce"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Vzhled"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Vzhled</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">přesunout do postranního panelu</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">skrýt</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">Z Wikipedie, otevřené encyklopedie</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="cs" dir="ltr"><figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/Soubor:Selection_sort_animation.gif" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Selection_sort_animation.gif/220px-Selection_sort_animation.gif" decoding="async" width="220" height="220" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/b/b0/Selection_sort_animation.gif 1.5x" data-file-width="288" data-file-height="288" /></a><figcaption>Ilustrace řazení výběrem na náhodné množině</figcaption></figure> <figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/Soubor:Selection-Sort-Animation.gif" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/9/94/Selection-Sort-Animation.gif" decoding="async" width="100" height="371" class="mw-file-element" data-file-width="100" data-file-height="371" /></a><figcaption>Animace řazení výběrem. Červeně je zvýrazněno aktuální minimum. Žlutě je označena srovnaná část seznamu. Modrá je aktuální položka</figcaption></figure> <p><b>Řazení výběrem</b> je v <a href="/wiki/Informatika" title="Informatika">informatice</a> implementačně jednoduchý <a href="/wiki/Algoritmus_%C5%99azen%C3%AD" class="mw-redirect" title="Algoritmus řazení">řadicí algoritmus</a> s časovou složitostí <span class="texhtml"><a href="/wiki/Asymptotick%C3%A1_slo%C5%BEitost" title="Asymptotická složitost"><i>O</i></a>(<var>N</var>²)</span>. Pro svou jednoduchou <a href="/wiki/Implementace" title="Implementace">implementaci</a> a nízký <a href="/w/index.php?title=Overhead&amp;action=edit&amp;redlink=1" class="new" title="Overhead (stránka neexistuje)">overhead</a> bývá často používán pro uspořádávání malých množství dat. Pro větší objem dat se používají algoritmy s nižší časovou složitostí <span class="texhtml"><i>O</i>(<var>N</var> log <var>N</var>)</span> jako <a href="/wiki/%C5%98azen%C3%AD_haldou" title="Řazení haldou">řazení haldou</a> nebo <a href="/wiki/%C5%98azen%C3%AD_slu%C4%8Dov%C3%A1n%C3%ADm" title="Řazení slučováním">řazení slučováním</a>. </p><p><a href="/wiki/Algoritmus" title="Algoritmus">Algoritmus</a> je univerzální (pracuje na základě porovnávání dvojic prvků), pracuje lokálně (nevyžaduje pomocnou paměť), není <a href="/wiki/Stabiln%C3%AD_%C5%99azen%C3%AD" title="Stabilní řazení">stabilním</a> (prvkům se stejným klíčem může změnit vzájemnou polohu) a nepatří mezi přirozené řadicí algoritmy (částečně seřazený seznam se bude zpracovávat stejně dlouho jako neseřazený). </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Princip">Princip</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit&amp;section=1" title="Editace sekce: Princip" class="mw-editsection-visualeditor"><span>editovat</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit&amp;section=1" title="Editovat zdrojový kód sekce Princip"><span>editovat zdroj</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Budeme uvažovat o vzestupném řazení. Seřazenou část budeme mít vlevo a vždy budeme hledat <a href="/wiki/Minimum" title="Minimum">minimum</a> z neseřazené části. Analogicky opačně se tento princip může aplikovat pro sestupné řazení. </p> <ol><li>Rozdělíme si posloupnost na seřazenou a neseřazenou část</li> <li>Najdeme prvek s nejmenší hodnotou v neseřazené části posloupnosti</li> <li>Zaměníme ho s prvkem na první pozici neseřazené části</li> <li>První prvek neseřazené části zahrneme do seřazené části a zároveň neseřazenou část zmenšíme o 1 prvek zleva</li> <li>Zbytek posloupnosti se uspořádá opakováním kroků 2 až 5 pro zbylou neseřazenou část</li></ol> <div class="mw-heading mw-heading2"><h2 id="Nestabilita_řazení"><span id="Nestabilita_.C5.99azen.C3.AD"></span>Nestabilita řazení</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit&amp;section=2" title="Editace sekce: Nestabilita řazení" class="mw-editsection-visualeditor"><span>editovat</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit&amp;section=2" title="Editovat zdrojový kód sekce Nestabilita řazení"><span>editovat zdroj</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Algoritmus není <a href="/wiki/Stabiln%C3%AD_%C5%99azen%C3%AD" title="Stabilní řazení">stabilním</a> (může změnit pořadí u prvků se shodným klíčem). </p><p>Je to dáno tím, že se prohazují nesousední prvky. Například pokud uvážíme <a href="/wiki/Mno%C5%BEina" title="Množina">množinu</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M=\{3_{1},2,3_{2},1\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <mn>2</mn> <mo>,</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mn>1</mn> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M=\{3_{1},2,3_{2},1\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2e99fb67934352fac44101e38131fb606a2bfe6a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:17.726ex; height:2.843ex;" alt="{\displaystyle M=\{3_{1},2,3_{2},1\}}"></span>, tak nám ji algoritmus seřadí jako <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M=\{1,2,3_{2},3_{1}\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mn>1</mn> <mo>,</mo> <mn>2</mn> <mo>,</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M=\{1,2,3_{2},3_{1}\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa85d02112bf827efdd7107e18ee8a33f7e5897b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:17.726ex; height:2.843ex;" alt="{\displaystyle M=\{1,2,3_{2},3_{1}\}}"></span>. Zde je jasně vidět, že algoritmus prohodil prvky <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{3_{1}\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{3_{1}\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/67d61551fb8eaf3e6c66d7f8daec44b3c9f2ce3c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.542ex; height:2.843ex;" alt="{\displaystyle \{3_{1}\}}"></span> a <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{3_{2}\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <msub> <mn>3</mn> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{3_{2}\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b0807ecf5de32db87a8c996fbc65731577ba26a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.542ex; height:2.843ex;" alt="{\displaystyle \{3_{2}\}}"></span>, což stabilní algoritmus řazení neudělá. </p><p>Řazení výběrem je možno implementovat i stabilně, pokud se místo záměny prvků použije přesunutí nalezeného nejmenšího prvku na příslušné místo, k tomu je ovšem potřeba použití datové struktury s rychlým vkládáním a odstraňováním, například <a href="/wiki/Spojov%C3%BD_seznam" class="mw-redirect" title="Spojový seznam">spojový seznam</a>, jinak výrazně zhorší výkonnost algoritmu. </p> <div class="mw-heading mw-heading2"><h2 id="Implementace_algoritmu">Implementace algoritmu</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit&amp;section=3" title="Editace sekce: Implementace algoritmu" class="mw-editsection-visualeditor"><span>editovat</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit&amp;section=3" title="Editovat zdrojový kód sekce Implementace algoritmu"><span>editovat zdroj</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Příklad v jazyce <a href="/wiki/C_(programovac%C3%AD_jazyk)" title="C (programovací jazyk)">C</a>: </p> <div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">selectionSort</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">data</span><span class="p">[],</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="p">)</span> <span class="p">{</span> <span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="n">j</span><span class="p">,</span><span class="w"> </span><span class="n">mi</span><span class="p">,</span><span class="w"> </span><span class="n">tmp</span><span class="p">;</span> <span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="cm">/* najdeme minimum */</span> <span class="w"> </span><span class="n">mi</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">i</span><span class="p">;</span> <span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">count</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">j</span><span class="p">]</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">data</span><span class="p">[</span><span class="n">mi</span><span class="p">])</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="n">mi</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">j</span><span class="p">;</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="cm">/* vyměníme data[i] a data[mi] */</span> <span class="w"> </span><span class="n">tmp</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> <span class="w"> </span><span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">data</span><span class="p">[</span><span class="n">mi</span><span class="p">];</span> <span class="w"> </span><span class="n">data</span><span class="p">[</span><span class="n">mi</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tmp</span><span class="p">;</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="Externí_odkazy"><span id="Extern.C3.AD_odkazy"></span>Externí odkazy</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;veaction=edit&amp;section=4" title="Editace sekce: Externí odkazy" class="mw-editsection-visualeditor"><span>editovat</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;action=edit&amp;section=4" title="Editovat zdrojový kód sekce Externí odkazy"><span>editovat zdroj</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><span class="wd"><span class="sisterproject sisterproject-commons"><span class="sisterproject_image"><span typeof="mw:File"><a href="/wiki/Wikimedia_Commons" title="Wikimedia Commons"><img alt="Logo Wikimedia Commons" src="//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/12px-Commons-logo.svg.png" decoding="async" width="12" height="16" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/18px-Commons-logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/24px-Commons-logo.svg.png 2x" data-file-width="1024" data-file-height="1376" /></a></span></span> <span class="sisterproject_text">Obrázky, zvuky či videa k tématu <span class="sisterproject_text_target"><a href="https://commons.wikimedia.org/wiki/Category:Selection_sort" class="extiw" title="c:Category:Selection sort">selection sort</a></span> na <a href="/wiki/Wikimedia_Commons" title="Wikimedia Commons">Wikimedia Commons</a></span></span></span><i> </i></li></ul> <style data-mw-deduplicate="TemplateStyles:r23078045">.mw-parser-output .navbox2{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox2 .navbox2{margin-top:0}.mw-parser-output .navbox2+.navbox2{margin-top:-1px}.mw-parser-output .navbox2-inner,.mw-parser-output .navbox2-subgroup{width:100%}.mw-parser-output .navbox2-group,.mw-parser-output .navbox2-title,.mw-parser-output .navbox2-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output th.navbox2-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox2,.mw-parser-output .navbox2-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox2-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output tr+tr>.navbox2-abovebelow,.mw-parser-output tr+tr>.navbox2-group,.mw-parser-output tr+tr>.navbox2-image,.mw-parser-output tr+tr>.navbox2-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox2 th,.mw-parser-output .navbox2-title{background-color:#e0e0e0}.mw-parser-output .navbox2-abovebelow,.mw-parser-output th.navbox2-group,.mw-parser-output .navbox2-subgroup .navbox2-title{background-color:#e7e7e7}.mw-parser-output .navbox2-subgroup .navbox2-title{font-size:88%}.mw-parser-output .navbox2-subgroup .navbox2-group,.mw-parser-output .navbox2-subgroup .navbox2-abovebelow{background-color:#f0f0f0}.mw-parser-output .navbox2-even{background-color:#f7f7f7}.mw-parser-output .navbox2-odd{background-color:transparent}.mw-parser-output .navbox2 .hlist td dl,.mw-parser-output .navbox2 .hlist td ol,.mw-parser-output .navbox2 .hlist td ul,.mw-parser-output .navbox2 td.hlist dl,.mw-parser-output .navbox2 td.hlist ol,.mw-parser-output .navbox2 td.hlist ul{padding:0.125em 0}</style> <!-- NewPP limit report Parsed by mw‐api‐int.codfw.main‐658b54f75f‐cpbg7 Cached time: 20241127223234 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.118 seconds Real time usage: 0.291 seconds Preprocessor visited node count: 126/1000000 Post‐expand include size: 1238/2097152 bytes Template argument size: 86/2097152 bytes Highest expansion depth: 7/100 Expensive parser function count: 2/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 5990/5000000 bytes Lua time usage: 0.039/10.000 seconds Lua memory usage: 1390012/52428800 bytes Number of Wikibase entities loaded: 1/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 114.785 1 -total 68.78% 78.950 1 Šablona:Commonscat 27.65% 31.735 1 Šablona:Autoritní_data 1.90% 2.178 2 Šablona:Math --> <!-- Saved in parser cache with key cswiki:pcache:114054:|#|:idhash:canonical and timestamp 20241127223234 and revision id 21314095. Rendering was triggered because: api-parse --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&amp;useformat=desktop" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Citováno z „<a dir="ltr" href="https://cs.wikipedia.org/w/index.php?title=Řazení_výběrem&amp;oldid=21314095">https://cs.wikipedia.org/w/index.php?title=Řazení_výběrem&amp;oldid=21314095</a>“</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/N%C3%A1pov%C4%9Bda:Kategorie" title="Nápověda:Kategorie">Kategorie</a>: <ul><li><a href="/wiki/Kategorie:%C5%98adic%C3%AD_algoritmy" title="Kategorie:Řadicí algoritmy">Řadicí algoritmy</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Skrytá kategorie: <ul><li><a href="/wiki/Kategorie:Monitoring:Autoritn%C3%AD_kontrola_s_0_identifik%C3%A1tory" title="Kategorie:Monitoring:Autoritní kontrola s 0 identifikátory">Monitoring:Autoritní kontrola s 0 identifikátory</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Stránka byla naposledy editována 22. 5. 2022 v 14:48.</li> <li id="footer-info-copyright">Text je dostupný pod <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.cs">licencí Creative Commons Uveďte původ&#160;– Zachovejte licenci</a>, případně za dalších podmínek. Podrobnosti naleznete na stránce <a class="external text" href="https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use/cs">Podmínky užití</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Ochrana osobních údajů</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedie">O Wikipedii</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedie:Vylou%C4%8Den%C3%AD_odpov%C4%9Bdnosti">Vyloučení odpovědnosti</a></li> <li id="footer-places-contact"><a href="//cs.wikipedia.org/wiki/Wikipedie:Kontakt">Kontaktujte Wikipedii</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Kodex chování</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Vývojáři</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/cs.wikipedia.org">Statistiky</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Prohlášení o cookies</a></li> <li id="footer-places-mobileview"><a href="//cs.m.wikipedia.org/w/index.php?title=%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobilní verze</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-759d5489db-6cvnv","wgBackendResponseTime":161,"wgPageParseReport":{"limitreport":{"cputime":"0.118","walltime":"0.291","ppvisitednodes":{"value":126,"limit":1000000},"postexpandincludesize":{"value":1238,"limit":2097152},"templateargumentsize":{"value":86,"limit":2097152},"expansiondepth":{"value":7,"limit":100},"expensivefunctioncount":{"value":2,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":5990,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 114.785 1 -total"," 68.78% 78.950 1 Šablona:Commonscat"," 27.65% 31.735 1 Šablona:Autoritní_data"," 1.90% 2.178 2 Šablona:Math"]},"scribunto":{"limitreport-timeusage":{"value":"0.039","limit":"10.000"},"limitreport-memusage":{"value":1390012,"limit":52428800}},"cachereport":{"origin":"mw-api-int.codfw.main-658b54f75f-cpbg7","timestamp":"20241127223234","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"\u0158azen\u00ed v\u00fdb\u011brem","url":"https:\/\/cs.wikipedia.org\/wiki\/%C5%98azen%C3%AD_v%C3%BDb%C4%9Brem","sameAs":"http:\/\/www.wikidata.org\/entity\/Q220831","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q220831","author":{"@type":"Organization","name":"P\u0159isp\u011bvatel\u00e9 projekt\u016f Wikimedia"},"publisher":{"@type":"Organization","name":"nadace Wikimedia","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2006-08-18T11:38:52Z","dateModified":"2022-05-22T13:48:16Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/b\/b0\/Selection_sort_animation.gif","headline":"\u0159ad\u00edc\u00ed algoritmus"}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10