CINXE.COM
Binäärinen hakupuu – Wikipedia
<!DOCTYPE html> <html class="client-nojs" lang="fi" dir="ltr"> <head> <meta charset="UTF-8"> <title>Binäärinen hakupuu – Wikipedia</title> <script>(function(){var className="client-js";var cookie=document.cookie.match(/(?:^|; )fiwikimwclientpreferences=([^;]+)/);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":"fi normal","wgMonthNames":["","tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],"wgRequestId":"98eedbc3-87fc-4238-b5db-5bb2ed7bf008","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Binäärinen_hakupuu","wgTitle":"Binäärinen hakupuu","wgCurRevisionId":20418026,"wgRevisionId":20418026,"wgArticleId":168025,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName": null,"wgUserGroups":["*"],"wgCategories":["Tietotekniikkatyngät","Tietorakenteet","Hakualgoritmit"],"wgPageViewLanguage":"fi","wgPageContentLanguage":"fi","wgPageContentModel":"wikitext","wgRelevantPageName":"Binäärinen_hakupuu","wgRelevantArticleId":168025,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":true,"wgFlaggedRevsParams":{"tags":{"accuracy":{"levels":3}}},"wgStableRevisionId":20418026,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"fi","pageLanguageDir":"ltr","pageVariantFallbacks":"fi"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":4000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition": "interlanguage","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q623818","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.gadget.hidePersonalSandboxEdits":"ready","ext.gadget.fiwiki_flaggedrevs_css_rcfix":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.pygments":"ready","ext.math.styles":"ready","skins.vector.styles.legacy":"ready","ext.flaggedRevs.basic":"ready","mediawiki.codex.messagebox.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","codex-search-styles":"ready", "ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.legacy.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.flaggedRevs.advanced","ext.gadget.publicarttablesort","ext.gadget.ViikonKilpailu","ext.gadget.WikiLovesMonunmets","ext.gadget.ProtectionIndicator","ext.gadget.frwiki_infobox_v3","ext.gadget.linkeddata","ext.gadget.perustiedotwikidatassa","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.compactlinks","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","oojs-ui.styles.icons-media","oojs-ui-core.icons", "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=fi&modules=codex-search-styles%7Cext.cite.styles%7Cext.flaggedRevs.basic%7Cext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.codex.messagebox.styles%7Cskins.vector.styles.legacy%7Cwikibase.client.init&only=styles&skin=vector"> <script async="" src="/w/load.php?lang=fi&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=fi&modules=ext.gadget.fiwiki_flaggedrevs_css_rcfix%2ChidePersonalSandboxEdits&only=styles&skin=vector"> <link rel="stylesheet" href="/w/load.php?lang=fi&modules=site.styles&only=styles&skin=vector"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <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/thumb/d/da/Binary_search_tree.svg/1200px-Binary_search_tree.svg.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="1000"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/800px-Binary_search_tree.svg.png"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="667"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/640px-Binary_search_tree.svg.png"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="533"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Binäärinen hakupuu – Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//fi.m.wikipedia.org/wiki/Bin%C3%A4%C3%A4rinen_hakupuu"> <link rel="alternate" type="application/x-wiki" title="Muokkaa" href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&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="Wikipedia (fi)"> <link rel="EditURI" type="application/rsd+xml" href="//fi.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://fi.wikipedia.org/wiki/Bin%C3%A4%C3%A4rinen_hakupuu"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fi"> <link rel="alternate" type="application/atom+xml" title="Wikipedia-Atom-syöte" href="/w/index.php?title=Toiminnot:Tuoreet_muutokset&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin-vector-legacy mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Binäärinen_hakupuu rootpage-Binäärinen_hakupuu skin-vector action-view"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"><!-- CentralNotice --></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Binäärinen hakupuu</span></h1> <div id="bodyContent" class="vector-body"> <div id="siteSub" class="noprint">Wikipediasta</div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Siirry navigaatioon</a> <a class="mw-jump-link" href="#searchInput">Siirry hakuun</a> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="fi" dir="ltr"><figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/Tiedosto:Binary_search_tree.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/250px-Binary_search_tree.svg.png" decoding="async" width="250" height="208" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/375px-Binary_search_tree.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/500px-Binary_search_tree.svg.png 2x" data-file-width="300" data-file-height="250" /></a><figcaption>Binäärinen hakupuu, jossa on yhdeksän solmua.</figcaption></figure> <p><b>Binäärinen hakupuu</b> (binäärihakupuu, <a href="/wiki/Englannin_kieli" title="Englannin kieli">engl.</a> <span lang="en"><i>binary search tree</i></span>, BST) on <a href="/wiki/Hakurakenne" title="Hakurakenne">hakurakenne</a>, joka on toteutettu <a href="/wiki/Bin%C3%A4%C3%A4ripuu" title="Binääripuu">binääripuun</a> avulla. Binäärisen hakupuun kaikille solmuille pätee, että solmun vasemmassa alipuussa on ainoastaan sitä pienempiä alkioita ja vastaavasti oikeassa alipuussa ainoastaan sitä suurempia alkioita.<sup id="cite_ref-Binary.Search.Tree_1-0" class="reference"><a href="#cite_note-Binary.Search.Tree-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p><p>Binäärisiä hakupuita käyttävät <a href="/wiki/Hakualgoritmi" title="Hakualgoritmi">haku</a>- ja <a href="/wiki/Lajittelualgoritmi" title="Lajittelualgoritmi">lajittelualgoritmit</a> ovat tyypillisesti erittäin tehokkaita. Hyvin tunnettu binäärisen hakupuun kehitetty versio on <a href="/wiki/Punamusta_puu" title="Punamusta puu">punamusta puu</a>.<sup id="cite_ref-Topcoder_2-0" class="reference"><a href="#cite_note-Topcoder-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> </p> <div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="fi" dir="ltr"><h2 id="mw-toc-heading">Sisällys</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div> <ul> <li class="toclevel-1 tocsection-1"><a href="#Toteutus"><span class="tocnumber">1</span> <span class="toctext">Toteutus</span></a></li> <li class="toclevel-1 tocsection-2"><a href="#Tehokkuus"><span class="tocnumber">2</span> <span class="toctext">Tehokkuus</span></a></li> <li class="toclevel-1 tocsection-3"><a href="#Lähteet"><span class="tocnumber">3</span> <span class="toctext">Lähteet</span></a></li> <li class="toclevel-1 tocsection-4"><a href="#Aiheesta_muualla"><span class="tocnumber">4</span> <span class="toctext">Aiheesta muualla</span></a></li> </ul> </div> <div class="mw-heading mw-heading2"><h2 id="Toteutus">Toteutus</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit&section=1" title="Muokkaa osiota Toteutus" class="mw-editsection-visualeditor"><span>muokkaa</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=edit&section=1" title="Muokkaa osion lähdekoodia: Toteutus"><span>muokkaa wikitekstiä</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Binääripuun hakualgoritmi toteutetaan yleensä <a href="/wiki/Rekursio" title="Rekursio">rekursiivisesti</a>. Esimerkkitoteutus <a href="/wiki/Pseudokoodi" title="Pseudokoodi">pseudokoodina</a>: </p> <ul><li><i>key</i>: avain, jonka arvoa haetaan</li> <li><i>node</i>: puun solmua kuvaava <a href="/wiki/Tietue" title="Tietue">tietue</a>; aluksi puun juuri</li> <li><i>node.key</i>: solmun avain</li> <li><i>node.value</i>: solmun arvo</li> <li><i>node.left</i>: solmun vasen alisolmu</li> <li><i>node.right</i>: solmun oikea alisolmu</li></ul> <div class="mw-highlight mw-highlight-lang-text mw-content-ltr" dir="ltr"><pre><span></span> function search_binary_tree(node, key) if node = null return null # ei löytynyt else if node.key = key return node.value # löytyi else if key < node.key return search_binary_tree(node.left, key) else # key > node.key return search_binary_tree(node.right, key) </pre></div> <p>Koska algoritmi on häntärekursiivinen, sen voi optimoida käyttämään toistoa rekursion sijaan. Jos tarvitaan säiliö eikä hakurakenne, niin avain ja arvo voidaan yhdistää. </p> <div class="mw-heading mw-heading2"><h2 id="Tehokkuus">Tehokkuus</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit&section=2" title="Muokkaa osiota Tehokkuus" class="mw-editsection-visualeditor"><span>muokkaa</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=edit&section=2" title="Muokkaa osion lähdekoodia: Tehokkuus"><span>muokkaa wikitekstiä</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Hakuoperaation suoritusaika on verrannollinen puun korkeuteen. Korkeus riippuu siitä, miten puu on muodostunut. Pahimmassa tapauksessa binääripuusta muodostuu täysin toispuolinen, jolloin hakuoperaation suoritusaika on kertaluokkaa <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 O(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/34109fe397fdcff370079185bfdb65826cb5565a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.977ex; height:2.843ex;" alt="{\displaystyle O(n)}"></span> eikä se ole lainkaan tehokkaampi kuin vaikkapa <a href="/wiki/Per%C3%A4kk%C3%A4ishaku" title="Peräkkäishaku">peräkkäishaku</a> linkitetystä listasta.<sup id="cite_ref-Trees_3-0" class="reference"><a href="#cite_note-Trees-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Linear.Search_4-0" class="reference"><a href="#cite_note-Linear.Search-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> Tasapainotetut hakupuut kuten <a href="/wiki/Punamusta_puu" title="Punamusta puu">punamusta puu</a> ratkaisevat ongelman.<sup id="cite_ref-Topcoder_2-1" class="reference"><a href="#cite_note-Topcoder-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Parhaassa tapauksessa puun korkeus on mahdollisimman pieni eli noin <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 \log _{2}n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>log</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>⁡<!-- --></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \log _{2}n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d74677fc45e0d926639433586327cbc2982eae89" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.808ex; height:2.676ex;" alt="{\displaystyle \log _{2}n}"></span>, missä <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 n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> on solmujen lukumäärä. Tällöin haun asymptoottinen suoritusaika on vastaavasti <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 O(\log n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(\log n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aae0f22048ba6b7c05dbae17b056bfa16e21807d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.336ex; height:2.843ex;" alt="{\displaystyle O(\log n)}"></span>.<sup id="cite_ref-Trees_3-1" class="reference"><a href="#cite_note-Trees-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Lähteet"><span id="L.C3.A4hteet"></span>Lähteet</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit&section=3" title="Muokkaa osiota Lähteet" class="mw-editsection-visualeditor"><span>muokkaa</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=edit&section=3" title="Muokkaa osion lähdekoodia: Lähteet"><span>muokkaa wikitekstiä</span></a><span class="mw-editsection-bracket">]</span></span></div> <div id="viitteet-malline" class="viitteet-malline" style="list-style-type:decimal;"><ol class="references"> <li id="cite_note-Binary.Search.Tree-1"><span class="mw-cite-backlink"><a href="#cite_ref-Binary.Search.Tree_1-0">↑</a></span> <span class="reference-text"><span class="verkkoviite" title="Verkkoviite"><a rel="nofollow" class="external text" href="https://www.hackerearth.com/practice/data-structures/trees/binary-search-tree/tutorial/">Binary Search Tree</a> <i>HackerEarth</i>. Viitattu 22.03.2018.</span></span> </li> <li id="cite_note-Topcoder-2"><span class="mw-cite-backlink">↑ <a href="#cite_ref-Topcoder_2-0"><sup><i>a</i></sup></a> <a href="#cite_ref-Topcoder_2-1"><sup><i>b</i></sup></a></span> <span class="reference-text"><span class="verkkoviite" title="Verkkoviite">cpphamza: <a rel="nofollow" class="external text" href="https://www.topcoder.com/community/data-science/data-science-tutorials/an-introduction-to-binary-search-and-red-black-trees/">An Introduction to Binary Search and Red-Black Trees</a> <i>Topcoder</i>.  2016. Viitattu 22.03.2018.</span></span> </li> <li id="cite_note-Trees-3"><span class="mw-cite-backlink">↑ <a href="#cite_ref-Trees_3-0"><sup><i>a</i></sup></a> <a href="#cite_ref-Trees_3-1"><sup><i>b</i></sup></a></span> <span class="reference-text"><span class="verkkoviite" title="Verkkoviite">Garg, Anuj: <a rel="nofollow" class="external text" href="https://www.hackerearth.com/practice/notes/trees/">Trees</a> <i>HackerEarth</i>.  2018. Viitattu 22.03.2018.</span></span> </li> <li id="cite_note-Linear.Search-4"><span class="mw-cite-backlink"><a href="#cite_ref-Linear.Search_4-0">↑</a></span> <span class="reference-text"><span class="verkkoviite" title="Verkkoviite"><a rel="nofollow" class="external text" href="https://www.hackerearth.com/practice/algorithms/searching/linear-search/tutorial/">Linear Search</a> <i>HackerEarth</i>.  2018. Viitattu 22.03.2018.</span></span> </li> </ol> </div> <div class="mw-heading mw-heading2"><h2 id="Aiheesta_muualla">Aiheesta muualla</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit&section=4" title="Muokkaa osiota Aiheesta muualla" class="mw-editsection-visualeditor"><span>muokkaa</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=edit&section=4" title="Muokkaa osion lähdekoodia: Aiheesta muualla"><span>muokkaa wikitekstiä</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r22431496">.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:#f9f9f9;display:flow-root}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}</style><div class="side-box side-box-right plainlinks sistersitebox"> <div class="side-box-flex"> <div class="side-box-image"><span class="noviewer" typeof="mw:File"><a href="/wiki/Tiedosto:Commons-logo.svg" class="mw-file-description"><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/30px-Commons-logo.svg.png" decoding="async" width="30" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/45px-Commons-logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/59px-Commons-logo.svg.png 2x" data-file-width="1024" data-file-height="1376" /></a></span></div> <div class="side-box-text plainlist"><a href="/wiki/Wikimedia_Commons" title="Wikimedia Commons">Wikimedia Commonsissa</a> on kuvia tai muita tiedostoja aiheesta <b><a href="https://commons.wikimedia.org/wiki/Category:Binary_search_trees" class="extiw" title="commons:Category:Binary search trees">Binäärinen hakupuu</a></b>.</div></div> </div> <ul><li><a rel="nofollow" class="external text" href="https://www.geeksforgeeks.org/binary-search-tree-set-1-search-and-insertion/">GeeksforGeeks: Binary Search Tree - Set 1 (Search and Insertion)</a></li> <li><a rel="nofollow" class="external text" href="https://www.geeksforgeeks.org/red-black-tree-set-1-introduction-2/">GeeksforGeeks: Red-Black Tree - Set 1 (Introduction)</a></li> <li><a rel="nofollow" class="external text" href="https://www.interviewbit.com/tutorial/binary-search-tree/">InterviewBit: Binary Search Tree</a></li></ul> <div id="stub" class="noprint" style="background-color: var( --background-color-neutral-subtle, #f8f9fa ); color: var( --color-emphasized, #101418 ); font-size: 95%; padding: 0.2em 0.2em 0.2em 2em; margin-top:1em; margin-bottom: 0.1em; border-top: 1px solid var( --border-color-subtle, #c8ccd1 ); clear: both"><i>Tämä <a href="/wiki/Tietotekniikka" title="Tietotekniikka">tietotekniikkaan</a> liittyvä artikkeli on <a href="/wiki/Wikipedia:Tynk%C3%A4" title="Wikipedia:Tynkä">tynkä</a>. Voit auttaa Wikipediaa <span class="plainlinks"><a class="external text" href="https://fi.wikipedia.org/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit">laajentamalla</a></span> artikkelia.</i><br /></div> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Noudettu kohteesta ”<a dir="ltr" href="https://fi.wikipedia.org/w/index.php?title=Binäärinen_hakupuu&oldid=20418026">https://fi.wikipedia.org/w/index.php?title=Binäärinen_hakupuu&oldid=20418026</a>”</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Toiminnot:Luokat" title="Toiminnot:Luokat">Luokat</a>: <ul><li><a href="/wiki/Luokka:Tietorakenteet" title="Luokka:Tietorakenteet">Tietorakenteet</a></li><li><a href="/wiki/Luokka:Hakualgoritmit" title="Luokka:Hakualgoritmit">Hakualgoritmit</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Piilotettu luokka: <ul><li><a href="/wiki/Luokka:Tietotekniikkatyng%C3%A4t" title="Luokka:Tietotekniikkatyngät">Tietotekniikkatyngät</a></li></ul></div></div> </div> </div> <div id="mw-navigation"> <h2>Navigointivalikko</h2> <div id="mw-head"> <nav id="p-personal" class="mw-portlet mw-portlet-personal vector-user-menu-legacy vector-menu" aria-labelledby="p-personal-label" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Henkilökohtaiset työkalut</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anonuserpage" class="mw-list-item"><span title="IP-osoitteesi käyttäjäsivu">Et ole kirjautunut</span></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Toiminnot:Oma_keskustelu" title="Keskustelu tämän IP-osoitteen muokkauksista [n]" accesskey="n"><span>Keskustelu</span></a></li><li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Toiminnot:Omat_muokkaukset" title="Luettelo tästä IP-osoitteesta tehdyistä muokkauksista [y]" accesskey="y"><span>Muokkaukset</span></a></li><li id="pt-createaccount" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:Luo_tunnus&returnto=Bin%C3%A4%C3%A4rinen+hakupuu" title="On suositeltavaa luoda käyttäjätunnus ja kirjautua sisään. Se ei kuitenkaan ole pakollista."><span>Luo tunnus</span></a></li><li id="pt-login" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:Kirjaudu_sis%C3%A4%C3%A4n&returnto=Bin%C3%A4%C3%A4rinen+hakupuu" title="On suositeltavaa kirjautua sisään. Se ei kuitenkaan ole pakollista. [o]" accesskey="o"><span>Kirjaudu sisään</span></a></li> </ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-namespaces-label" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Nimiavaruudet</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected mw-list-item"><a href="/wiki/Bin%C3%A4%C3%A4rinen_hakupuu" title="Näytä sisältösivu [c]" accesskey="c"><span>Artikkeli</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/w/index.php?title=Keskustelu:Bin%C3%A4%C3%A4rinen_hakupuu&action=edit&redlink=1" rel="discussion" class="new" title="Keskustele sisällöstä (sivua ei ole) [t]" accesskey="t"><span>Keskustelu</span></a></li> </ul> </div> </nav> <nav id="p-variants" class="mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-variants-label" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" > <label id="p-variants-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">suomi</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-views-label" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Näkymät</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected mw-list-item"><a href="/wiki/Bin%C3%A4%C3%A4rinen_hakupuu"><span>Lue</span></a></li><li id="ca-ve-edit" class="mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&veaction=edit" title="Muokkaa tätä sivua [v]" accesskey="v"><span>Muokkaa</span></a></li><li id="ca-edit" class="collapsible mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=edit" title="Muokkaa tämän sivun lähdekoodia [e]" accesskey="e"><span>Muokkaa wikitekstiä</span></a></li><li id="ca-history" class="mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=history" title="Sivun aikaisemmat versiot [h]" accesskey="h"><span>Näytä historia</span></a></li> </ul> </div> </nav> <nav id="p-cactions" class="mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-cactions-label" title="Lisää valintoja" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" > <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Muut</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <h3 >Haku</h3> <form action="/w/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Hae Wikipediasta" aria-label="Hae Wikipediasta" autocapitalize="sentences" title="Hae Wikipediasta [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Toiminnot:Haku"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Hae sivuilta tätä tekstiä" value="Hae"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Siirry sivulle, joka on tarkalleen tällä nimellä" value="Siirry"> </div> </form> </div> </div> </div> <div id="mw-panel" class="vector-legacy-sidebar"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="/wiki/Wikipedia:Etusivu" title="Etusivu"></a> </div> <nav id="p-navigation" class="mw-portlet mw-portlet-navigation vector-menu-portal portal vector-menu" aria-labelledby="p-navigation-label" > <h3 id="p-navigation-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Valikko</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikipedia:Etusivu" title="Siirry etusivulle [z]" accesskey="z"><span>Etusivu</span></a></li><li id="n-aboutsite" class="mw-list-item"><a href="/wiki/Wikipedia:Tietoja"><span>Tietoja Wikipediasta</span></a></li><li id="n-allarticles" class="mw-list-item"><a href="/wiki/Wikipedia:Selaa_luokittain"><span>Kaikki sivut</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Toiminnot:Satunnainen_sivu" title="Avaa satunnainen sivu [x]" accesskey="x"><span>Satunnainen artikkeli</span></a></li> </ul> </div> </nav> <nav id="p-interaction" class="mw-portlet mw-portlet-interaction vector-menu-portal portal vector-menu" aria-labelledby="p-interaction-label" > <h3 id="p-interaction-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Osallistuminen</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Ohje:Sis%C3%A4llys" title="Ohjeita"><span>Ohje</span></a></li><li id="n-Kahvihuone" class="mw-list-item"><a href="/wiki/Wikipedia:Kahvihuone"><span>Kahvihuone</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Wikipedia:Ajankohtaista" title="Taustatietoa tämänhetkisistä tapahtumista"><span>Ajankohtaista</span></a></li><li id="n-Tuoreet-odottavat-muutokset" class="mw-list-item"><a href="//fi.wikipedia.org/wiki/Toiminnot:Tuoreet_muutokset?damaging=&goodfaith=&hideliu=0&hideanons=0&userExpLevel=&hidemyself=0&hidebyothers=0&hidebots=1&hidehumans=0&hidepatrolled=1&hideunpatrolled=0&hideminor=0&hidemajor=0&hidepageedits=0&hidenewpages=0&hidecategorization=1&hideWikibase=1&hidelog=0&highlight=1&goodfaith__verylikelybad_color=c5&goodfaith__likelybad_color=c4&goodfaith__maybebad_color=c3&damaging__verylikelybad_color=c5&damaging__likelybad_color=c4&damaging__maybebad_color=c3"><span>Tuoreet odottavat muutokset</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Toiminnot:Tuoreet_muutokset" title="Luettelo tuoreista muutoksista [r]" accesskey="r"><span>Tuoreet muutokset</span></a></li><li id="n-sitesupport" class="mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_fi.wikipedia.org&uselang=fi" title="Tue meitä"><span>Lahjoitukset</span></a></li> </ul> </div> </nav> <nav id="p-tb" class="mw-portlet mw-portlet-tb vector-menu-portal portal vector-menu" aria-labelledby="p-tb-label" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Työkalut</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Toiminnot:T%C3%A4nne_viittaavat_sivut/Bin%C3%A4%C3%A4rinen_hakupuu" title="Lista sivuista, jotka viittaavat tänne [j]" accesskey="j"><span>Tänne viittaavat sivut</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Toiminnot:Linkitetyt_muutokset/Bin%C3%A4%C3%A4rinen_hakupuu" rel="nofollow" title="Viimeisimmät muokkaukset sivuissa, joille viitataan tältä sivulta [k]" accesskey="k"><span>Linkitettyjen sivujen muutokset</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Toiminnot:Toimintosivut" title="Näytä toimintosivut [q]" accesskey="q"><span>Toimintosivut</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&oldid=20418026" title="Ikilinkki tämän sivun tähän versioon"><span>Ikilinkki</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&action=info" title="Enemmän tietoa tästä sivusta"><span>Sivun tiedot</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:Viittaus&page=Bin%C3%A4%C3%A4rinen_hakupuu&id=20418026&wpFormIdentifier=titleform" title="Tietoa tämän sivun lainaamisesta"><span>Viitetiedot</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:UrlShortener&url=https%3A%2F%2Ffi.wikipedia.org%2Fwiki%2FBin%25C3%25A4%25C3%25A4rinen_hakupuu"><span>Lyhennä URL-osoite</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:QrCode&url=https%3A%2F%2Ffi.wikipedia.org%2Fwiki%2FBin%25C3%25A4%25C3%25A4rinen_hakupuu"><span>Lataa QR-koodi</span></a></li> </ul> </div> </nav> <nav id="p-coll-print_export" class="mw-portlet mw-portlet-coll-print_export vector-menu-portal portal vector-menu" aria-labelledby="p-coll-print_export-label" > <h3 id="p-coll-print_export-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tulosta/vie</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Toiminnot:DownloadAsPdf&page=Bin%C3%A4%C3%A4rinen_hakupuu&action=show-download-screen"><span>Lataa PDF-tiedostona</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&printable=yes" title="Tulostettava versio [p]" accesskey="p"><span>Tulostettava versio</span></a></li> </ul> </div> </nav> <nav id="p-wikibase-otherprojects" class="mw-portlet mw-portlet-wikibase-otherprojects vector-menu-portal portal vector-menu" aria-labelledby="p-wikibase-otherprojects-label" > <h3 id="p-wikibase-otherprojects-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Muissa hankkeissa</span> </h3> <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:Binary_search_trees" 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/Q623818" title="Linkki yhdistettyyn keskustietovaraston kohteeseen [g]" accesskey="g"><span>Wikidata-kohde</span></a></li> </ul> </div> </nav> <nav id="p-lang" class="mw-portlet mw-portlet-lang vector-menu-portal portal vector-menu" aria-labelledby="p-lang-label" > <h3 id="p-lang-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Muilla kielillä</span> </h3> <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%B4%D8%AC%D8%B1%D8%A9_%D8%A8%D8%AD%D8%AB_%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9" title="شجرة بحث ثنائية — arabia" lang="ar" hreflang="ar" data-title="شجرة بحث ثنائية" data-language-autonym="العربية" data-language-local-name="arabia" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Pohon_Pencarian_Biner" title="Pohon Pencarian Biner — indonesia" lang="id" hreflang="id" data-title="Pohon Pencarian Biner" data-language-autonym="Bahasa Indonesia" data-language-local-name="indonesia" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-bs mw-list-item"><a href="https://bs.wikipedia.org/wiki/Binarno_stablo_pretra%C5%BEivanja" title="Binarno stablo pretraživanja — bosnia" lang="bs" hreflang="bs" data-title="Binarno stablo pretraživanja" data-language-autonym="Bosanski" data-language-local-name="bosnia" class="interlanguage-link-target"><span>Bosanski</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/%D0%94%D0%B2%D0%BE%D0%B8%D1%87%D0%BD%D0%BE_%D0%B4%D1%8A%D1%80%D0%B2%D0%BE_%D0%B7%D0%B0_%D1%82%D1%8A%D1%80%D1%81%D0%B5%D0%BD%D0%B5" title="Двоично дърво за търсене — bulgaria" lang="bg" hreflang="bg" data-title="Двоично дърво за търсене" data-language-autonym="Български" data-language-local-name="bulgaria" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Arbre_binari_de_cerca" title="Arbre binari de cerca — katalaani" lang="ca" hreflang="ca" data-title="Arbre binari de cerca" data-language-autonym="Català" data-language-local-name="katalaani" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Bin%C3%A1rn%C3%AD_vyhled%C3%A1vac%C3%AD_strom" title="Binární vyhledávací strom — tšekki" lang="cs" hreflang="cs" data-title="Binární vyhledávací strom" data-language-autonym="Čeština" data-language-local-name="tšekki" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Bin%C3%A6rt_s%C3%B8getr%C3%A6" title="Binært søgetræ — tanska" lang="da" hreflang="da" data-title="Binært søgetræ" data-language-autonym="Dansk" data-language-local-name="tanska" 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/Bin%C3%A4rer_Suchbaum" title="Binärer Suchbaum — saksa" lang="de" hreflang="de" data-title="Binärer Suchbaum" data-language-autonym="Deutsch" data-language-local-name="saksa" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-en badge-Q17437798 badge-goodarticle mw-list-item" title="hyvä artikkeli"><a href="https://en.wikipedia.org/wiki/Binary_search_tree" title="Binary search tree — englanti" lang="en" hreflang="en" data-title="Binary search tree" data-language-autonym="English" data-language-local-name="englanti" 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/%C3%81rbol_binario_de_b%C3%BAsqueda" title="Árbol binario de búsqueda — espanja" lang="es" hreflang="es" data-title="Árbol binario de búsqueda" data-language-autonym="Español" data-language-local-name="espanja" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%AF%D8%B1%D8%AE%D8%AA_%D8%AC%D8%B3%D8%AA%D8%AC%D9%88%DB%8C_%D8%AF%D9%88%D8%AF%D9%88%DB%8C%DB%8C" title="درخت جستجوی دودویی — persia" lang="fa" hreflang="fa" data-title="درخت جستجوی دودویی" data-language-autonym="فارسی" data-language-local-name="persia" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Arbre_binaire_de_recherche" title="Arbre binaire de recherche — ranska" lang="fr" hreflang="fr" data-title="Arbre binaire de recherche" data-language-autonym="Français" data-language-local-name="ranska" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EC%9D%B4%EC%A7%84_%ED%83%90%EC%83%89_%ED%8A%B8%EB%A6%AC" title="이진 탐색 트리 — korea" lang="ko" hreflang="ko" data-title="이진 탐색 트리" data-language-autonym="한국어" data-language-local-name="korea" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikipedia.org/wiki/%D4%B2%D5%AB%D5%B6%D5%A1%D6%80_%D5%B8%D6%80%D5%B8%D5%B6%D5%B4%D5%A1%D5%B6_%D5%AE%D5%A1%D5%BC" title="Բինար որոնման ծառ — armenia" lang="hy" hreflang="hy" data-title="Բինար որոնման ծառ" data-language-autonym="Հայերեն" data-language-local-name="armenia" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Albero_binario_di_ricerca" title="Albero binario di ricerca — italia" lang="it" hreflang="it" data-title="Albero binario di ricerca" data-language-autonym="Italiano" data-language-local-name="italia" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%A2%D7%A5_%D7%97%D7%99%D7%A4%D7%95%D7%A9" title="עץ חיפוש — heprea" lang="he" hreflang="he" data-title="עץ חיפוש" data-language-autonym="עברית" data-language-local-name="heprea" 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%AC%E0%B3%88%E0%B2%A8%E0%B2%B0%E0%B2%BF_%E0%B2%B8%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%8D_%E0%B2%9F%E0%B3%8D%E0%B2%B0%E0%B3%80_(%E0%B2%AC%E0%B3%88%E0%B2%A8%E0%B2%B0%E0%B2%BF_%E0%B2%B9%E0%B3%81%E0%B2%A1%E0%B3%81%E0%B2%95%E0%B2%BE%E0%B2%9F%E0%B2%A6_%E0%B2%9F%E0%B3%8D%E0%B2%B0%E0%B3%80)" title="ಬೈನರಿ ಸರ್ಚ್ ಟ್ರೀ (ಬೈನರಿ ಹುಡುಕಾಟದ ಟ್ರೀ) — kannada" lang="kn" hreflang="kn" data-title="ಬೈನರಿ ಸರ್ಚ್ ಟ್ರೀ (ಬೈನರಿ ಹುಡುಕಾಟದ ಟ್ರೀ)" data-language-autonym="ಕನ್ನಡ" data-language-local-name="kannada" class="interlanguage-link-target"><span>ಕನ್ನಡ</span></a></li><li class="interlanguage-link interwiki-lmo mw-list-item"><a href="https://lmo.wikipedia.org/wiki/Alber_binari_de_ricerca" title="Alber binari de ricerca — lombardi" lang="lmo" hreflang="lmo" data-title="Alber binari de ricerca" data-language-autonym="Lombard" data-language-local-name="lombardi" class="interlanguage-link-target"><span>Lombard</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Binaire_zoekboom" title="Binaire zoekboom — hollanti" lang="nl" hreflang="nl" data-title="Binaire zoekboom" data-language-autonym="Nederlands" data-language-local-name="hollanti" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E4%BA%8C%E5%88%86%E6%8E%A2%E7%B4%A2%E6%9C%A8" title="二分探索木 — japani" lang="ja" hreflang="ja" data-title="二分探索木" data-language-autonym="日本語" data-language-local-name="japani" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Binarne_drzewo_poszukiwa%C5%84" title="Binarne drzewo poszukiwań — puola" lang="pl" hreflang="pl" data-title="Binarne drzewo poszukiwań" data-language-autonym="Polski" data-language-local-name="puola" 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/%C3%81rvore_bin%C3%A1ria_de_busca" title="Árvore binária de busca — portugali" lang="pt" hreflang="pt" data-title="Árvore binária de busca" data-language-autonym="Português" data-language-local-name="portugali" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/Arbore_binar_de_c%C4%83utare" title="Arbore binar de căutare — romania" lang="ro" hreflang="ro" data-title="Arbore binar de căutare" data-language-autonym="Română" data-language-local-name="romania" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%94%D0%B2%D0%BE%D0%B8%D1%87%D0%BD%D0%BE%D0%B5_%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE_%D0%BF%D0%BE%D0%B8%D1%81%D0%BA%D0%B0" title="Двоичное дерево поиска — venäjä" lang="ru" hreflang="ru" data-title="Двоичное дерево поиска" data-language-autonym="Русский" data-language-local-name="venäjä" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/Bin%C3%A1rny_vyh%C4%BEad%C3%A1vac%C3%AD_strom" title="Binárny vyhľadávací strom — slovakki" lang="sk" hreflang="sk" data-title="Binárny vyhľadávací strom" data-language-autonym="Slovenčina" data-language-local-name="slovakki" 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/Binarno_stablo_pretrage" title="Binarno stablo pretrage — serbia" lang="sr" hreflang="sr" data-title="Binarno stablo pretrage" data-language-autonym="Српски / srpski" data-language-local-name="serbia" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/Binarno_stablo_pretrage" title="Binarno stablo pretrage — serbokroaatti" lang="sh" hreflang="sh" data-title="Binarno stablo pretrage" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="serbokroaatti" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Bin%C3%A4rt_s%C3%B6ktr%C3%A4d" title="Binärt sökträd — ruotsi" lang="sv" hreflang="sv" data-title="Binärt sökträd" data-language-autonym="Svenska" data-language-local-name="ruotsi" 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%95%E0%B9%89%E0%B8%99%E0%B9%84%E0%B8%A1%E0%B9%89%E0%B8%84%E0%B9%89%E0%B8%99%E0%B8%AB%E0%B8%B2%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%97%E0%B8%A7%E0%B8%B4%E0%B8%A0%E0%B8%B2%E0%B8%84" title="ต้นไม้ค้นหาแบบทวิภาค — thai" lang="th" hreflang="th" data-title="ต้นไม้ค้นหาแบบทวิภาค" data-language-autonym="ไทย" data-language-local-name="thai" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/C%C3%A2y_t%C3%ACm_ki%E1%BA%BFm_nh%E1%BB%8B_ph%C3%A2n" title="Cây tìm kiếm nhị phân — vietnam" lang="vi" hreflang="vi" data-title="Cây tìm kiếm nhị phân" data-language-autonym="Tiếng Việt" data-language-local-name="vietnam" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/%C4%B0kili_arama_a%C4%9Fac%C4%B1" title="İkili arama ağacı — turkki" lang="tr" hreflang="tr" data-title="İkili arama ağacı" data-language-autonym="Türkçe" data-language-local-name="turkki" 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%94%D0%B2%D1%96%D0%B9%D0%BA%D0%BE%D0%B2%D0%B5_%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE_%D0%BF%D0%BE%D1%88%D1%83%D0%BA%D1%83" title="Двійкове дерево пошуку — ukraina" lang="uk" hreflang="uk" data-title="Двійкове дерево пошуку" data-language-autonym="Українська" data-language-local-name="ukraina" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E4%BA%8C%E5%85%83%E6%90%9C%E5%B0%8B%E6%A8%B9" title="二元搜尋樹 — kantoninkiina" lang="yue" hreflang="yue" data-title="二元搜尋樹" data-language-autonym="粵語" data-language-local-name="kantoninkiina" class="interlanguage-link-target"><span>粵語</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E4%BA%8C%E5%85%83%E6%90%9C%E5%B0%8B%E6%A8%B9" title="二元搜尋樹 — kiina" lang="zh" hreflang="zh" data-title="二元搜尋樹" data-language-autonym="中文" data-language-local-name="kiina" 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/Q623818#sitelinks-wikipedia" title="Muokkaa kieltenvälisiä linkkejä" class="wbc-editpage">Muokkaa linkkejä</a></span></div> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Sivua on viimeksi muutettu 12. huhtikuuta 2022 kello 00.03.</li> <li id="footer-info-copyright">Teksti on saatavilla <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fi">Creative Commons Attribution/Share-Alike</a> -lisenssillä; lisäehtoja voi sisältyä. Katso <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use/fi">käyttöehdot</a>.<br /> Wikipedia® on <a rel="nofollow" class="external text" href="https://wikimediafoundation.org/">Wikimedia Foundationin</a> rekisteröimä tavaramerkki.<br /> <a href="/wiki/Wikipedia:Artikkelien_ongelmat" title="Wikipedia:Artikkelien ongelmat">Ongelma artikkelissa?</a></li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Tietosuojakäytäntö</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:Tietoja">Tietoja Wikipediasta</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:Vastuuvapaus">Vastuuvapaus</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Käytössäännöstö</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Kehittäjät</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/fi.wikipedia.org">Tilastot</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Evästekäytäntö</a></li> <li id="footer-places-mobileview"><a href="//fi.m.wikipedia.org/w/index.php?title=Bin%C3%A4%C3%A4rinen_hakupuu&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobiilinäkymä</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> <script>(RLQ=window.RLQ||[]).push(function(){mw.log.warn("This page is using the deprecated ResourceLoader module \"codex-search-styles\".\n[1.43] Use a CodexModule with codexComponents to set your specific components used: https://www.mediawiki.org/wiki/Codex#Using_a_limited_subset_of_components");mw.config.set({"wgHostname":"mw-web.codfw.canary-84779d6bf6-wgwwp","wgBackendResponseTime":162,"wgPageParseReport":{"limitreport":{"cputime":"0.099","walltime":"0.505","ppvisitednodes":{"value":420,"limit":1000000},"postexpandincludesize":{"value":6324,"limit":2097152},"templateargumentsize":{"value":453,"limit":2097152},"expansiondepth":{"value":18,"limit":100},"expensivefunctioncount":{"value":1,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":4415,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 162.936 1 -total"," 29.75% 48.469 1 Malline:Commonscat"," 28.44% 46.344 1 Malline:Commons"," 27.29% 44.473 1 Malline:Sister_project"," 26.05% 42.443 1 Malline:Side_box"," 25.92% 42.234 4 Malline:Wikidata"," 15.15% 24.690 1 Malline:Viitteet"," 10.95% 17.835 4 Malline:Verkkoviite"," 4.41% 7.180 1 Malline:Tynkä/Tietotekniikka"," 2.86% 4.657 1 Malline:K-en"]},"scribunto":{"limitreport-timeusage":{"value":"0.016","limit":"10.000"},"limitreport-memusage":{"value":747334,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-587f7d4878-qzd6g","timestamp":"20241120124048","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Bin\u00e4\u00e4rinen hakupuu","url":"https:\/\/fi.wikipedia.org\/wiki\/Bin%C3%A4%C3%A4rinen_hakupuu","sameAs":"http:\/\/www.wikidata.org\/entity\/Q623818","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q623818","author":{"@type":"Organization","name":"Wikimedia-hankkeiden muokkaajat"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2006-05-12T19:02:47Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/d\/da\/Binary_search_tree.svg","headline":"bin\u00e4\u00e4ripuuhun perustuva hakurakenne"}</script> </body> </html>