CINXE.COM
Binarno stablo pretrage — Википедија
<!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="sr" dir="ltr"> <head> <meta charset="UTF-8"> <title>Binarno stablo pretrage — Википедија</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(/(?:^|; )srwikimwclientpreferences=([^;]+)/);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":"hh:mm d. month y.","wgMonthNames":["","јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],"wgRequestId":"5d9ef16f-7a45-4b48-b2d2-4676b03efd43","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Binarno_stablo_pretrage","wgTitle":"Binarno stablo pretrage","wgCurRevisionId":28057103,"wgRevisionId":28057103,"wgArticleId":923467,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Pages using deprecated source tags","Непроверени семинарски радови","Шаблон:Категорија на Остави/параметар/ненаведен/име странице различито од Википодатака","Шаблон:Категорија на Остави/именски простор/главни", "Чланци са примерима C++ кода","Чланци са примерима Јава кода","Чланци са примерима Пајтон кода","Бинарна стабла","Стабла (структуре података)","Типови података"],"wgPageViewLanguage":"sr","wgPageContentLanguage":"sr","wgPageContentModel":"wikitext","wgRelevantPageName":"Binarno_stablo_pretrage","wgRelevantArticleId":923467,"wgTempUserName":null,"wgUserVariant":"sr","wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"sr","pageLanguageDir":"ltr","pageVariantFallbacks":"sr-ec"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false, "wgWMEPageLength":30000,"wgRelatedArticlesCompat":[],"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q623818","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false,"wgSiteNoticeId":"2.24"};RLSTATE={"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.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","ext.dismissableSiteNotice.styles":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.ReferenceTooltips","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","ext.dismissableSiteNotice"];</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=sr&modules=ext.cite.styles%7Cext.dismissableSiteNotice.styles%7Cext.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&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=sr&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=sr&modules=site.styles&only=styles&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/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="Binarno stablo pretrage — Википедија"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//sr.m.wikipedia.org/wiki/Binarno_stablo_pretrage"> <link rel="alternate" type="application/x-wiki" title="Уреди" href="/w/index.php?title=Binarno_stablo_pretrage&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="Википедија (sr)"> <link rel="EditURI" type="application/rsd+xml" href="//sr.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://sr.wikipedia.org/wiki/Binarno_stablo_pretrage"> <link rel="alternate" hreflang="sr" href="https://sr.wikipedia.org/wiki/Binarno_stablo_pretrage"> <link rel="alternate" hreflang="sr-Cyrl" href="https://sr.wikipedia.org/sr-ec/Binarno_stablo_pretrage"> <link rel="alternate" hreflang="sr-Latn" href="https://sr.wikipedia.org/sr-el/Binarno_stablo_pretrage"> <link rel="alternate" hreflang="x-default" href="https://sr.wikipedia.org/wiki/Binarno_stablo_pretrage"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.sr"> <link rel="alternate" type="application/atom+xml" title="Википедија – Atom фид" href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A1%D0%BA%D0%BE%D1%80%D0%B0%D1%88%D1%9A%D0%B5_%D0%B8%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5&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-Binarno_stablo_pretrage rootpage-Binarno_stablo_pretrage skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Пређи на садржај</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="Сајт"> <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="Главни мени" > <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">Главни мени</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">Главни мени</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">помери на страну</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">сакриј</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Навигација </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage" class="mw-list-item"><a href="/wiki/%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B0" title="Посетите главну страну [z]" accesskey="z"><span>Главна страна</span></a></li><li id="n-contents" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A1%D0%B0%D0%B4%D1%80%D0%B6%D0%B0%D1%98" title="Водичи за прегледање Википедије"><span>Садржај</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A1%D0%BA%D0%BE%D1%80%D0%B0%D1%88%D1%9A%D0%B5_%D0%B8%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5" title="Списак скорашњих измена на пројекту [r]" accesskey="r"><span>Скорашње измене</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9D%D0%B0%D1%81%D1%83%D0%BC%D0%B8%D1%87%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0" title="Посетите насумичну страницу [x]" accesskey="x"><span>Случајна страница</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%90%D0%BA%D1%82%D1%83%D0%B5%D0%BB%D0%BD%D0%BE%D1%81%D1%82%D0%B8" title="Пронађите информације о актуелностима"><span>Актуелности</span></a></li><li id="n-contactpage" class="mw-list-item"><a href="//sr.wikipedia.org/wiki/Википедија:Контакт" title="Сазнајте како да ступите у контакт с уредницима"><span>Контакт</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Интеракција </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D0%BC%D0%BE%D1%9B:%D0%A1%D0%B0%D0%B4%D1%80%D0%B6%D0%B0%D1%98" title="Место где можете да се информишете"><span>Помоћ</span></a></li><li id="n-introduction" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%94%D0%BE%D0%B1%D1%80%D0%BE_%D0%B4%D0%BE%D1%88%D0%BB%D0%B8"><span>Научите да уређујете</span></a></li><li id="n-sidebar-village-pump" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3"><span>Трг</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A0%D0%B0%D0%B4%D0%B8%D0%BE%D0%BD%D0%B8%D1%86%D0%B0" title="О пројекту, шта можете да радите и где да пронађете ствари"><span>Радионица</span></a></li><li id="n-noticeboard" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%9E%D0%B3%D0%BB%D0%B0%D1%81%D0%BD%D0%B0_%D1%82%D0%B0%D0%B1%D0%BB%D0%B0"><span>Огласна табла</span></a></li><li id="n-upload" class="mw-list-item"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%92%D0%BE%D0%B4%D0%B8%D1%87_%D0%B7%D0%B0_%D0%BE%D1%82%D0%BF%D1%80%D0%B5%D0%BC%D0%B0%D1%9A%D0%B5"><span>Отпреми датотеку</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B0" 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="Википедија" src="/static/images/mobile/copyright/wikipedia-wordmark-sr.svg" style="width: 7.8125em; height: 1.4375em;"> <img class="mw-logo-tagline" alt="" src="/static/images/mobile/copyright/wikipedia-tagline-sr.svg" width="120" height="11" style="width: 7.5em; height: 0.6875em;"> </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/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9F%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B6%D0%B8" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Претражите пројекат Википедија [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Претрага</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="Претражите Википедију" aria-label="Претражите Википедију" autocapitalize="sentences" title="Претражите пројекат Википедија [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Посебно:Претражи"> </div> <button class="cdx-button cdx-search-input__end-button">Претражи</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Личне алатке"> <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="Изглед"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Мења се приказ странице; величина фонта, ширина и боја" > <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="Изглед" > <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">Изглед</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="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=sr.wikipedia.org&uselang=sr" class=""><span>Донације</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=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9E%D1%82%D0%B2%D0%BE%D1%80%D0%B8_%D0%BD%D0%B0%D0%BB%D0%BE%D0%B3&returnto=Binarno+stablo+pretrage" title="Иако није обавезно, препоручујемо да отворите налог и пријавите се" class=""><span>Отвори налог</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=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9A%D0%BE%D1%80%D0%B8%D1%81%D0%BD%D0%B8%D1%87%D0%BA%D0%B0_%D0%BF%D1%80%D0%B8%D1%98%D0%B0%D0%B2%D0%B0&returnto=Binarno+stablo+pretrage" title="Иако није обавезно, препоручујемо да се пријавите [o]" accesskey="o" class=""><span>Пријави ме</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 user-links-collapsible-item" title="Више опција" > <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="Личне алатке" > <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">Личне алатке</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Кориснички мени" > <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="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=sr.wikipedia.org&uselang=sr"><span>Донације</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9E%D1%82%D0%B2%D0%BE%D1%80%D0%B8_%D0%BD%D0%B0%D0%BB%D0%BE%D0%B3&returnto=Binarno+stablo+pretrage" title="Иако није обавезно, препоручујемо да отворите налог и пријавите се"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Отвори налог</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9A%D0%BE%D1%80%D0%B8%D1%81%D0%BD%D0%B8%D1%87%D0%BA%D0%B0_%D0%BF%D1%80%D0%B8%D1%98%D0%B0%D0%B2%D0%B0&returnto=Binarno+stablo+pretrage" title="Иако није обавезно, препоручујемо да се пријавите [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Пријави ме</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"><div id="mw-dismissablenotice-anonplace"></div><script>(function(){var node=document.getElementById("mw-dismissablenotice-anonplace");if(node){node.outerHTML="\u003Cdiv class=\"mw-dismissable-notice\"\u003E\u003Cdiv class=\"mw-dismissable-notice-close\"\u003E[\u003Ca tabindex=\"0\" role=\"button\"\u003Eодбаци\u003C/a\u003E]\u003C/div\u003E\u003Cdiv class=\"mw-dismissable-notice-body\"\u003E\u003C!-- CentralNotice --\u003E\u003Cdiv id=\"localNotice\" data-nosnippet=\"\"\u003E\u003Cdiv class=\"sitenotice\" lang=\"sr\" dir=\"ltr\"\u003E\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #f0f0f0; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EПрикључите се гласању на тему \u003Cb\u003E\u003Ca href=\"/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%93%D0%BB%D0%B0%D1%81%D0%B0%D1%9A%D0%B5/%D0%A0%D0%B5%D0%B4%D0%B8%D0%B7%D0%B0%D1%98%D0%BD_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0_%D0%B7%D0%B0_%D0%B4%D0%BE%D0%B1%D1%80%D0%B5,_%D1%81%D1%98%D0%B0%D1%98%D0%BD%D0%B5_%D0%B8_%D0%B8%D0%B7%D0%B0%D0%B1%D1%80%D0%B0%D0%BD%D0%B5_%D1%81%D0%BF%D0%B8%D1%81%D0%BA%D0%BE%D0%B2%D0%B5\" title=\"Википедија:Гласање/Редизајн страница за добре, сјајне и изабране спискове\"\u003Eредизајна страница за добре, сјајне и ИС\u003C/a\u003E\u003C/b\u003E.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\n\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #FBEBEA; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EПокренут је \u003Cb\u003E\u003Ca href=\"/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A3%D1%80%D0%B5%D1%92%D0%B8%D0%B2%D0%B0%D1%87%D0%BA%D0%B8_%D0%BC%D0%B0%D1%80%D0%B0%D1%82%D0%BE%D0%BD_%D0%92%D0%B8%D0%BA%D0%B8_%D0%B2%D0%BE%D0%BB%D0%B8_%D1%81%D0%BF%D0%BE%D0%BC%D0%B5%D0%BD%D0%B8%D0%BA%D0%B5_2024.\" title=\"Википедија:Уређивачки маратон Вики воли споменике 2024.\"\u003EУређивачки маратон Вики воли споменике 2024\u003C/a\u003E\u003C/b\u003E.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\n\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #FBEBEA; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EУ току је такмичење у писању чланака на тему \u003Cb\u003E\u003Ca href=\"/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D0%B0%D0%BA%D0%BC%D0%B8%D1%87%D0%B5%D1%9A%D0%B5_%D1%83_%D0%BF%D0%B8%D1%81%D0%B0%D1%9A%D1%83_%D1%87%D0%BB%D0%B0%D0%BD%D0%B0%D0%BA%D0%B0/%D0%A3_%D1%81%D0%B2%D0%B5%D1%82%D1%83_%D0%A4%D0%BB%D0%BE%D1%80%D0%B5_%D0%B8_%D0%A4%D0%B0%D1%83%D0%BD%D0%B5\" title=\"Википедија:Такмичење у писању чланака/У свету Флоре и Фауне\"\u003EФлоре и фауне\u003C/a\u003E\u003C/b\u003E.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\n\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #FBEBEA; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EПридружите се \u003Cb\u003E\u003Ca href=\"/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A3%D1%80%D0%B5%D1%92%D0%B8%D0%B2%D0%B0%D1%87%D0%BA%D0%B8_%D0%BC%D0%B0%D1%80%D0%B0%D1%82%D0%BE%D0%BD_%D0%92%D0%B8%D0%BA%D0%B8_%D0%B2%D0%BE%D0%BB%D0%B8_%D1%98%D0%B0%D0%B2%D0%BD%D1%83_%D1%83%D0%BC%D0%B5%D1%82%D0%BD%D0%BE%D1%81%D1%82_%D0%B8_%D0%B3%D1%80%D0%BE%D0%B1%D0%BD%D0%B0_%D0%BE%D0%B1%D0%B5%D0%BB%D0%B5%D0%B6%D1%98%D0%B0_2024.\" title=\"Википедија:Уређивачки маратон Вики воли јавну уметност и гробна обележја 2024.\"\u003EУређивачком маратону Вики воли јавну уметност и гробна обележја 2024\u003C/a\u003E\u003C/b\u003E.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\n\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #FBEBEA; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EУчествујте у \u003Cb\u003E\u003Ca href=\"https://sr.wikiquote.org/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D1%86%D0%B8%D1%82%D0%B0%D1%82:%D0%9A%D0%B0%D0%BC%D0%BF%D0%B0%D1%9A%D0%B0_SheSaid_2024\" class=\"extiw\" title=\"q:Викицитат:Кампања SheSaid 2024\"\u003Eкампањи писања цитата значајних жена\u003C/a\u003E\u003C/b\u003E на Викицитату.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\n\u003Cdiv class=\"noticebanner\"\u003E\u003Cdiv class=\"plainlinks\" style=\"background-color: #FBEBEA; border-radius:5px; margin-top:10px; position:relative; border: 1px solid #aaa; font-family: \u0026#39;Helvetica\u0026#39;, \u0026#39;Arial\u0026#39;, sans-serif; line-height: 18px; box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); overflow:hidden;\"\u003E\u003Cdiv style=\"display:block; top:4px; width:100%; text-align:center;;\"\u003E\u003Cdiv style=\"color:#000085; font-size:25px; line-height:25px\"\u003E\u003Cdiv style=\"padding-left:50px;\"\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv style=\"padding-top:2px; color:#444; font-size:1.15em; line-height:1.5;\"\u003E\u003Cdiv style=\"padding-left:8px; padding-right:8px;\"\u003EПридружите се \u003Cb\u003E\u003Ca href=\"/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%90%D0%BA%D1%86%D0%B8%D1%98%D0%B0_%D0%BF%D1%80%D0%BE%D1%88%D0%B8%D1%80%D0%B8%D0%B2%D0%B0%D1%9A%D0%B0_%D0%BA%D0%BB%D0%B8%D1%86%D0%B0\" title=\"Википедија:Акција проширивања клица\"\u003Eакцији проширивања клица\u003C/a\u003E\u003C/b\u003E.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E";}}());</script></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="Сајт"> <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="Садржај" 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">Садржај</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">помери на страну</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">сакриј</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">Почетак</div> </a> </li> <li id="toc-Provera_da_li_je_stablo_BSP_ili_nije" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Provera_da_li_je_stablo_BSP_ili_nije"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Provera da li je stablo BSP ili nije</span> </div> </a> <ul id="toc-Provera_da_li_je_stablo_BSP_ili_nije-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Razlike_između_binarnog_stabla_i_binarnog_stabla_pretrage" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Razlike_između_binarnog_stabla_i_binarnog_stabla_pretrage"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Razlike između binarnog stabla i binarnog stabla pretrage</span> </div> </a> <ul id="toc-Razlike_između_binarnog_stabla_i_binarnog_stabla_pretrage-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Operacije" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Operacije"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Operacije</span> </div> </a> <button aria-controls="toc-Operacije-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Садржај одељка Operacije</span> </button> <ul id="toc-Operacije-sublist" class="vector-toc-list"> <li id="toc-Pretraga" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Pretraga"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>Pretraga</span> </div> </a> <ul id="toc-Pretraga-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Ubacivanje_elementa" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Ubacivanje_elementa"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>Ubacivanje elementa</span> </div> </a> <ul id="toc-Ubacivanje_elementa-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Brisanje_elementa" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Brisanje_elementa"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.3</span> <span>Brisanje elementa</span> </div> </a> <ul id="toc-Brisanje_elementa-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Obilazak_stabla" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Obilazak_stabla"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.4</span> <span>Obilazak stabla</span> </div> </a> <ul id="toc-Obilazak_stabla-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Sortiranje" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Sortiranje"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5</span> <span>Sortiranje</span> </div> </a> <ul id="toc-Sortiranje-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Vrste" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Vrste"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Vrste</span> </div> </a> <button aria-controls="toc-Vrste-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Садржај одељка Vrste</span> </button> <ul id="toc-Vrste-sublist" class="vector-toc-list"> <li id="toc-Poređenje_performansi" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Poređenje_performansi"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>Poređenje performansi</span> </div> </a> <ul id="toc-Poređenje_performansi-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Optimalno_binarno_stablo_pretrage" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Optimalno_binarno_stablo_pretrage"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2</span> <span>Optimalno binarno stablo pretrage</span> </div> </a> <ul id="toc-Optimalno_binarno_stablo_pretrage-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Vidi_još" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Vidi_još"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Vidi još</span> </div> </a> <ul id="toc-Vidi_još-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Reference" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Reference"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Reference</span> </div> </a> <ul id="toc-Reference-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Literatura" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Literatura"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Literatura</span> </div> </a> <ul id="toc-Literatura-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Spoljašnje_veze" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Spoljašnje_veze"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>Spoljašnje veze</span> </div> </a> <ul id="toc-Spoljašnje_veze-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="Садржај" 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="Прикажи/сакриј садржај" > <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">Прикажи/сакриј садржај</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">Binarno stablo pretrage</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="Чланак на другим језицима. Доступан на: 34" > <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-34" 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">34 језика</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%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="شجرة بحث ثنائية — арапски" lang="ar" hreflang="ar" data-title="شجرة بحث ثنائية" data-language-autonym="العربية" data-language-local-name="арапски" 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 — индонежански" lang="id" hreflang="id" data-title="Pohon Pencarian Biner" data-language-autonym="Bahasa Indonesia" data-language-local-name="индонежански" class="interlanguage-link-target"><span>Bahasa Indonesia</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="Двоично дърво за търсене — бугарски" lang="bg" hreflang="bg" data-title="Двоично дърво за търсене" data-language-autonym="Български" data-language-local-name="бугарски" class="interlanguage-link-target"><span>Български</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 — босански" lang="bs" hreflang="bs" data-title="Binarno stablo pretraživanja" data-language-autonym="Bosanski" data-language-local-name="босански" class="interlanguage-link-target"><span>Bosanski</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 — каталонски" lang="ca" hreflang="ca" data-title="Arbre binari de cerca" data-language-autonym="Català" data-language-local-name="каталонски" 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 — чешки" lang="cs" hreflang="cs" data-title="Binární vyhledávací strom" data-language-autonym="Čeština" data-language-local-name="чешки" 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æ — дански" lang="da" hreflang="da" data-title="Binært søgetræ" data-language-autonym="Dansk" data-language-local-name="дански" 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 — немачки" lang="de" hreflang="de" data-title="Binärer Suchbaum" data-language-autonym="Deutsch" data-language-local-name="немачки" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-en badge-Q17437798 badge-goodarticle mw-list-item" title="добар чланак"><a href="https://en.wikipedia.org/wiki/Binary_search_tree" title="Binary search tree — енглески" lang="en" hreflang="en" data-title="Binary search tree" data-language-autonym="English" data-language-local-name="енглески" 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 — шпански" lang="es" hreflang="es" data-title="Árbol binario de búsqueda" data-language-autonym="Español" data-language-local-name="шпански" 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="درخت جستجوی دودویی — персијски" lang="fa" hreflang="fa" data-title="درخت جستجوی دودویی" data-language-autonym="فارسی" data-language-local-name="персијски" 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 — француски" lang="fr" hreflang="fr" data-title="Arbre binaire de recherche" data-language-autonym="Français" data-language-local-name="француски" 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%A2%D7%A5_%D7%97%D7%99%D7%A4%D7%95%D7%A9" title="עץ חיפוש — хебрејски" lang="he" hreflang="he" data-title="עץ חיפוש" data-language-autonym="עברית" data-language-local-name="хебрејски" 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="Բինար որոնման ծառ — јерменски" lang="hy" hreflang="hy" data-title="Բինար որոնման ծառ" data-language-autonym="Հայերեն" data-language-local-name="јерменски" 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 — италијански" lang="it" hreflang="it" data-title="Albero binario di ricerca" data-language-autonym="Italiano" data-language-local-name="италијански" 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/%E4%BA%8C%E5%88%86%E6%8E%A2%E7%B4%A2%E6%9C%A8" title="二分探索木 — јапански" lang="ja" hreflang="ja" data-title="二分探索木" data-language-autonym="日本語" data-language-local-name="јапански" 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="ಬೈನರಿ ಸರ್ಚ್ ಟ್ರೀ (ಬೈನರಿ ಹುಡುಕಾಟದ ಟ್ರೀ) — канада" lang="kn" hreflang="kn" data-title="ಬೈನರಿ ಸರ್ಚ್ ಟ್ರೀ (ಬೈನರಿ ಹುಡುಕಾಟದ ಟ್ರೀ)" data-language-autonym="ಕನ್ನಡ" data-language-local-name="канада" 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%9D%B4%EC%A7%84_%ED%83%90%EC%83%89_%ED%8A%B8%EB%A6%AC" title="이진 탐색 트리 — корејски" lang="ko" hreflang="ko" data-title="이진 탐색 트리" data-language-autonym="한국어" data-language-local-name="корејски" 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 — ломбард" lang="lmo" hreflang="lmo" data-title="Alber binari de ricerca" data-language-autonym="Lombard" data-language-local-name="ломбард" 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 — холандски" lang="nl" hreflang="nl" data-title="Binaire zoekboom" data-language-autonym="Nederlands" data-language-local-name="холандски" 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/Binarne_drzewo_poszukiwa%C5%84" title="Binarne drzewo poszukiwań — пољски" lang="pl" hreflang="pl" data-title="Binarne drzewo poszukiwań" data-language-autonym="Polski" data-language-local-name="пољски" 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 — португалски" lang="pt" hreflang="pt" data-title="Árvore binária de busca" data-language-autonym="Português" data-language-local-name="португалски" 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 — румунски" lang="ro" hreflang="ro" data-title="Arbore binar de căutare" data-language-autonym="Română" data-language-local-name="румунски" 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="Двоичное дерево поиска — руски" lang="ru" hreflang="ru" data-title="Двоичное дерево поиска" data-language-autonym="Русский" data-language-local-name="руски" 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 — словачки" lang="sk" hreflang="sk" data-title="Binárny vyhľadávací strom" data-language-autonym="Slovenčina" data-language-local-name="словачки" class="interlanguage-link-target"><span>Slovenčina</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 — српскохрватски" lang="sh" hreflang="sh" data-title="Binarno stablo pretrage" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="српскохрватски" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Bin%C3%A4%C3%A4rinen_hakupuu" title="Binäärinen hakupuu — фински" lang="fi" hreflang="fi" data-title="Binäärinen hakupuu" data-language-autonym="Suomi" data-language-local-name="фински" class="interlanguage-link-target"><span>Suomi</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 — шведски" lang="sv" hreflang="sv" data-title="Binärt sökträd" data-language-autonym="Svenska" data-language-local-name="шведски" 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="ต้นไม้ค้นหาแบบทวิภาค — тајски" lang="th" hreflang="th" data-title="ต้นไม้ค้นหาแบบทวิภาค" data-language-autonym="ไทย" data-language-local-name="тајски" 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 — вијетнамски" 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="вијетнамски" 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ı — турски" lang="tr" hreflang="tr" data-title="İkili arama ağacı" data-language-autonym="Türkçe" data-language-local-name="турски" 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="Двійкове дерево пошуку — украјински" lang="uk" hreflang="uk" data-title="Двійкове дерево пошуку" data-language-autonym="Українська" data-language-local-name="украјински" 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="二元搜尋樹 — кинески" lang="zh" hreflang="zh" data-title="二元搜尋樹" data-language-autonym="中文" data-language-local-name="кинески" 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="二元搜尋樹 — кантонски" lang="yue" hreflang="yue" data-title="二元搜尋樹" data-language-autonym="粵語" data-language-local-name="кантонски" 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="Уреди међујезичке везе" class="wbc-editpage">Уреди везе</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="Именски простори"> <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/Binarno_stablo_pretrage" title="Прочитајте овај чланак [c]" accesskey="c"><span>Чланак</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/%D0%A0%D0%B0%D0%B7%D0%B3%D0%BE%D0%B2%D0%BE%D1%80:Binarno_stablo_pretrage" rel="discussion" title="Разговарајте о страници [t]" accesskey="t"><span>Разговор</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown " > <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="Промени варијанту језика" > <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">Ћир./lat.</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-varlang-0" class="selected ca-variants-sr mw-list-item"><a href="/sr/Binarno_stablo_pretrage" lang="sr" hreflang="sr"><span>Ћир./lat.</span></a></li><li id="ca-varlang-1" class="ca-variants-sr-Cyrl mw-list-item"><a href="/sr-ec/Binarno_stablo_pretrage" lang="sr-Cyrl" hreflang="sr-Cyrl"><span>Ћирилица</span></a></li><li id="ca-varlang-2" class="ca-variants-sr-Latn mw-list-item"><a href="/sr-el/Binarno_stablo_pretrage" lang="sr-Latn" hreflang="sr-Latn"><span>Latinica</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Погледи"> <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/Binarno_stablo_pretrage"><span>Читај</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit" title="Уредите ову страницу [v]" accesskey="v"><span>Уреди</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit" title="Уредите изворни код ове странице [e]" accesskey="e"><span>Уреди извор</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&action=history" title="Историја [h]" accesskey="h"><span>Историја</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Алатке странице"> <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="Алатке" > <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">Алатке</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">Алатке</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">помери на страну</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">сакриј</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Више опција" > <div class="vector-menu-heading"> Радње </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/Binarno_stablo_pretrage"><span>Читај</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit" title="Уредите ову страницу [v]" accesskey="v"><span>Уреди</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit" title="Уредите изворни код ове странице [e]" accesskey="e"><span>Уреди извор</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&action=history"><span>Историја</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Опште </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A8%D1%82%D0%B0_%D0%B2%D0%BE%D0%B4%D0%B8_%D0%BE%D0%B2%D0%B0%D0%BC%D0%BE/Binarno_stablo_pretrage" title="Списак свих вики страница које воде овамо [j]" accesskey="j"><span>Шта води овамо</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9F%D0%BE%D0%B2%D0%B5%D0%B7%D0%B0%D0%BD%D0%B5_%D0%B8%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5/Binarno_stablo_pretrage" rel="nofollow" title="Скорашње измене страница које су повезане с овом [k]" accesskey="k"><span>Повезане измене</span></a></li><li id="t-upload" class="mw-list-item"><a href="/wiki/Википедија:Водич_за_отпремање" title="Поставите слике и снимке [u]" accesskey="u"><span>Отпреми датотеку</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%B5_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B5" title="Списак свих посебних страница [q]" accesskey="q"><span>Посебне странице</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&oldid=28057103" title="Трајна веза до ове измене на овој страници"><span>Трајна веза</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Binarno_stablo_pretrage&action=info" title="Више информација о овој страници"><span>Подаци о страници</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A6%D0%B8%D1%82%D0%B8%D1%80%D0%B0%D1%98&page=Binarno_stablo_pretrage&id=28057103&wpFormIdentifier=titleform" title="Информације о томе како цитирати ову страницу"><span>Цитирај страницу</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A1%D0%BA%D1%80%D0%B0%D1%9B%D0%B8%D0%B2%D0%B0%D1%87_%D0%B0%D0%B4%D1%80%D0%B5%D1%81%D0%B0&url=https%3A%2F%2Fsr.wikipedia.org%2Fwiki%2FBinarno_stablo_pretrage"><span>Кратки URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:QrCode&url=https%3A%2F%2Fsr.wikipedia.org%2Fwiki%2FBinarno_stablo_pretrage"><span>Преузми QR код</span></a></li> </ul> </div> </div> <div id="p-electronpdfservice-sidebar-portlet-heading" class="vector-menu mw-portlet mw-portlet-electronpdfservice-sidebar-portlet-heading" > <div class="vector-menu-heading"> Штампање/извоз </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="electron-print_pdf" class="mw-list-item"><a href="/w/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:DownloadAsPdf&page=Binarno_stablo_pretrage&action=show-download-screen"><span>Преузми у PDF-у</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Одштампајте ову страницу [p]" accesskey="p"><span>Одштампај</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"> На другим пројектима </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:Binary_search_trees" hreflang="en"><span>Викиостава</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="Веза ка ставци на спремишту података [g]" accesskey="g"><span>Ставка на Википодацима</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="Алатке странице"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Изглед"> <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">Изглед</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">помери на страну</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">сакриј</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">С Википедије, слободне енциклопедије</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="sr" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r28855813">.mw-parser-output .tmbox{margin:4px 0;border-collapse:collapse;border:1px solid #c0c090;background-color:#f8eaba;box-sizing:border-box}.mw-parser-output .tmbox.mbox-small{font-size:88%;line-height:1.25em}.mw-parser-output .tmbox-speedy{border:2px solid #b32424;background-color:#fee7e6}.mw-parser-output .tmbox-delete{border:2px solid #b32424}.mw-parser-output .tmbox-content{border:2px solid #f28500}.mw-parser-output .tmbox-style{border:2px solid #fc3}.mw-parser-output .tmbox-move{border:2px solid #9932cc}.mw-parser-output .tmbox .mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .tmbox .mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .tmbox .mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output .tmbox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .tmbox .mbox-invalid-type{text-align:center}@media(min-width:720px){.mw-parser-output .tmbox{margin:4px 10%}.mw-parser-output .tmbox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;width:238px}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .tmbox{background-color:#2e2505}html.skin-theme-clientpref-night .mw-parser-output .tmbox-speedy{background-color:#310402}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .tmbox{background-color:#2e2505}html.skin-theme-clientpref-os .mw-parser-output .tmbox-speedy{background-color:#310402}}body.skin--responsive .mw-parser-output table.tmbox img{max-width:none!important}</style><table id="breeditnotice" class="plainlinks tmbox tmbox-notice" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Information_icon4.svg/40px-Information_icon4.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Information_icon4.svg/60px-Information_icon4.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Information_icon4.svg/80px-Information_icon4.svg.png 2x" data-file-width="620" data-file-height="620" /></span></span></td><td class="mbox-text">Овај чланак је започет или проширен кроз пројекат <a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A1%D0%B5%D0%BC%D0%B8%D0%BD%D0%B0%D1%80%D1%81%D0%BA%D0%B8_%D1%80%D0%B0%D0%B4%D0%BE%D0%B2%D0%B8" title="Википедија:Семинарски радови">семинарских радова</a>. Потребно је проверити превод, правопис и вики-синтаксу.<br /><small>Када завршите са провером, допишете <i><b>да</b></i> након <span class="nowrap"><b>|проверено=</b></span>.</small> </td></tr></tbody></table> <figure class="mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Binary_search_tree.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/200px-Binary_search_tree.svg.png" decoding="async" width="200" height="167" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/300px-Binary_search_tree.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/da/Binary_search_tree.svg/400px-Binary_search_tree.svg.png 2x" data-file-width="300" data-file-height="250" /></a><figcaption>Binarno stablo pretrage veličine 9 i dubine 3, sa korenom 8 i listovima 1, 4, 7 i 13</figcaption></figure> <p>U <a href="/wiki/%D0%98%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0" title="Информатика">informatici</a>, <b>binarno stablo pretrage</b> (<b>BSP</b>), poznato i kao <b>sortirano binarno stablo</b>, je <a href="/wiki/%D0%91%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="Бинарно стабло">binarno stablo</a> zasnovano na čvorovima, gde svaki čvor ima uporedljivi ključ (sa dodeljenom vrednošću) i zadovoljava uslov da je vrednost svakog čvora veća od vrednosti svakog čvora u njegovom levom podstablu i manja od vrednosti svakog čvora u njegovom desnom podstablu. Svaki čvor ima najviše dva deteta. Svako dete mora da bude ili list (nema nijedno dete) ili koren još jednog binarnog stabla pretrage. BSP je dinamička <a href="/wiki/%D0%A1%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0" title="Структура података">struktura podataka</a>, i veličina BSP-a je ograničena samo količinom slobodne memorije u operativnom sistemu. Najveća prednost binarnog stabla pretrage je da ostaje uređeno, što omogućava brže vreme pretrage nego većina drugih struktura. Osnovna svojstva binarnog stabla pretrage:<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p> <ul><li>Levo podstablo čvora sadrži samo čvorove koje imaju manju vrednost od njega.</li> <li>Desno podstablo čvora sadrži samo čvorove koje imaju veću vrednost od njega.</li> <li>Levo i desno podstablo moraju takođe biti binarna stabla pretrage.</li> <li>Svaki čvor može imati najviše 2 deteta.</li> <li>Ne smeju postojati duplikati čvorova.</li> <li>Postoji jedinstven put od korena do svakog čvora.</li></ul> <p>Najveća prednost binarnog stabla pretrage u odnosu na ostale strukture podataka je da <a href="/wiki/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D0%B8_%D1%81%D0%BE%D1%80%D1%82%D0%B8%D1%80%D0%B0%D1%9A%D0%B0" title="Алгоритми сортирања">algoritmi sortiranja</a> i <a href="/wiki/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D0%B8_%D0%BF%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B6%D0%B8%D0%B2%D0%B0%D1%9A%D0%B0" title="Алгоритми претраживања">algoritmi pretrage</a> kao npr. pretraga u dubinu (in-order) mogu biti veoma efikasni. Ostale prednosti su: </p> <ul><li>Binarno stablo pretrage ima brzo ubacivanje i brisanje elemenata kada je balansirano.</li> <li>Kod je jednostavniji nego kod ostalih struktura podataka.</li> <li>Čuva ključeve u čvorovima na takav način da se pretraga, ubacivanje i brisanje elemenata može uraditi efikasno.</li> <li>Veoma jednostavna implementacija.</li> <li>Čvorovi u stablu su dinamički po prirodi.</li></ul> <p>Binarno stablo pretrage je fundamentalna struktura podataka pomoću koje se konstruišu apstraktnije strukture podataka kao npr. <a href="/wiki/%D0%A1%D0%BA%D1%83%D0%BF_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0)" title="Скуп (структура података)">skupovi</a>, multiskupovi i <a href="/wiki/%D0%90%D1%81%D0%BE%D1%86%D0%B8%D1%98%D0%B0%D1%82%D0%B8%D0%B2%D0%BD%D0%B8_%D0%BD%D0%B8%D0%B7" title="Асоцијативни низ">asocijativni nizovi</a>. Neki od nedostataka su: </p> <ul><li>Oblik binarnog stabla pretrage zavisi samo od reda ubacivanja elemenata, i može biti degenerisano.</li> <li>Kada ubacujemo ili tražimo element u binarnom stablu pretrage, ključ svakog posećenog čvora mora da se uporedi sa ključem elementa kog ubacujemo ili tražimo.</li> <li>Ključevi u binarnom stablu pretrage mogu biti dugački, što može uticati na vremensku složenost.</li></ul> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Provera_da_li_je_stablo_BSP_ili_nije">Provera da li je stablo BSP ili nije</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=1" title="Уредите одељак „Provera da li je stablo BSP ili nije”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=1" title="Уреди извор одељка: Provera da li je stablo BSP ili nije"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Ponekad imamo binarno stablo, i potrebno je odrediti da li je ono BSP. Ovo je zanimljiv problem koji ima jednostavno rekurzivno rešenje. </p><p>BSP svojstvo--svaki čvor u desnom podstablu mora da bude veći od trenutnog čvora i svaki čvor u levom podstablu mora da bude manji (ili jednak) od trenutnog čvora--je ključna stvar pomoću koje određujemo da li je stablo BSP ili nije. Na prvi pogled, izgleda kao da je dovoljno samo da obiđemo stablo, proverimo da li svaki čvor sadrži vrednost koja je veća od vrednosti njegovog levog deteta i manja od vrednosti njegovog desnog deteta, i ako ovo tvrđenje važi za svaki čvor u stablu, onda je to BSP. Ovo je takozvani "Pohlepni pristup". Ali, očigledno je da ovaj pristup neće raditi za sledeće stablo: </p> <pre> 20 / \ 10 30 / \ 5 40 </pre> <p>I navedenom stablu, svaki čvor zadovoljava uslov da sadrži vrednost veću od njegovog levog deteta a manju od desnog, ali ipak, to nije BSP: vrednost 5 je u desnom podstablu čvora koji sadrži 20, što nije u skladu sa svojstvom BSP. </p><p>Kako rešiti ovo? Ispostavlja se da umesto da donesemo odluku zasnovanu isključivo na vrednosti čvora i njegove dece, potrebne su nam informacije koje potiču i od roditelja. U prethodnom primeru, kada bismo zapamtili čvor sa vrednošću 20, videli bismo da čvor sa vrednošću 5 ne zadovoljava uslove BSP. </p><p>Tako da, uslovi koje treba da proverimo za svaki čvor su: a) ako je čvor levo dete svog roditelja, onda mora biti manji (ili jednak) od roditelja i mora da prenese vrednost od svog roditelja svom desnom podstablu da bi bili sigurni da nijedan od čvorova u tom podstablu nije veća od roditelja, i slično b) ako je čvor desno dete svog roditelja, onda mora biti veće od svog roditelja i mora da prenese vrednost od svog roditelja svom levom podstablu da bi bili sigurno da nijedan od čvorova u tom podstablu nije manji od roditelja. </p><p>Jednostavno, ali elegantno rekurzivno rešenje u Javi, može da objasni ovo malo bolje: </p> <pre> public static boolean isBST(TreeNode node, int leftData, int rightData) { if (node == null) return true; if (node.getData() > leftData || node.getData() <= rightData) return false; return (isBST(node.left, node.getData(), rightData) && isBST(node.right, leftData, node.getData())); } </pre> <p>Poziv ove funkcije može izgledati ovako: </p> <pre> if(isBST(root, Integer.MAX_VALUE, Integer.MIN_VALUE)) System.out.println("This is a BST."); else System.out.println("This is NOT a BST!"); </pre> <div class="mw-heading mw-heading2"><h2 id="Razlike_između_binarnog_stabla_i_binarnog_stabla_pretrage"><span id="Razlike_izme.C4.91u_binarnog_stabla_i_binarnog_stabla_pretrage"></span>Razlike između binarnog stabla i binarnog stabla pretrage</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=2" title="Уредите одељак „Razlike između binarnog stabla i binarnog stabla pretrage”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=2" title="Уреди извор одељка: Razlike između binarnog stabla i binarnog stabla pretrage"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Binarno stablo: Ukratko, <a href="/wiki/%D0%91%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="Бинарно стабло">binarno stablo</a> je stablo kod koga svaki čvor ima dva najviše dva deteta. U binarnom stablu, levo i desno dete mogu imati vrednosti nezavisne od vrednosti roditelja. </p> <pre> 3 / \ 4 5 </pre> <p>Binarno stablo pretrage: Kod binarnog stabla pretrage, levo dete sadrži vrednost manju od roditelja, a desno dete sadrži vrednost koja je veća od vrednosti roditelja. </p> <pre> 4 / \ 3 5 </pre> <div class="mw-heading mw-heading2"><h2 id="Operacije">Operacije</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=3" title="Уредите одељак „Operacije”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=3" title="Уреди извор одељка: Operacije"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Operacije, kao što su <i><b>pretraga</b></i>, kod binarnog stabla zahtevaju poređenje između čvorova. Ova poređenja se obavljaju sa pozivima <a href="/wiki/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%98%D0%B0_(%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D1%9A%D0%B5)" title="Функција (програмирање)">funkciji</a> <i>komparatora</i>. <i>Komparator</i> može biti definisam implicitno ili eksplicitno, u zavisnosti od jezika u kome je implementirano binarno stablo pretrage. Čest <i>komparator</i> je manje od funkcije, na primer, <i>a</i> < <i>b</i>, gde su <i>a</i> i <i>b</i> ključevi dva čvora <i>a</i> i <i>b</i> u binarnom stablu pretrage. </p> <div class="mw-heading mw-heading3"><h3 id="Pretraga">Pretraga</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=4" title="Уредите одељак „Pretraga”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=4" title="Уреди извор одељка: Pretraga"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Pretraga binarnog stabla pretrage za određenim ključem može se uraditi rekurzivno ili iterativno. </p><p>Počinjemo sa korenim čvorem. Ako je stablo <i>null</i>, onda ključ koji tražimo ne postoji u stablu. Ako je ključ jednak korenu, onda je pretraga gotova i vraćamo čvor. Ako je ključ manji od vrednosti korena, onda pretražujemo levo podstablo. Slično tome, ako je ključ veći od korena, pretražujemo desno podstablo. Ovaj proces se ponavlja sve dok ne pronađemo ključ ili preostalo podstablo ne postane <i>null</i>. Ako ključ nije pronađen pre nego što dođemo do <i>null</i> podstabla, onda taj ključ ne postoji u stablu. Ovo se lako radi sa rekurzivnim algoritmom: </p> <pre><b>function</b> <u>Find-recursive</u>(key, node): <i>// call initially with node = root</i> <b>if</b> node = Null <b>or</b> node.key = key <b>then</b> <b>return</b> node <b>else if</b> key < node.key <b>then</b> <b>return</b> <u>Find-recursive</u>(key, node.left) <b>else</b> <b>return</b> <u>Find-recursive</u>(key, node.right) </pre> <p>Isti algoritam se može implementirati iterativno: </p> <pre><b>function</b> <u>Find</u>(key, root): current-node := root <b>while</b> current-node <b>is not Null do</b> <b>if</b> current-node.key = key <b>then</b> <b>return</b> current-node <b>else if</b> key < current-node.key <b>then</b> current-node := current-node.left <b>else</b> current-node := current-node.right <b>return Null</b> </pre> <p>U najgorem slučaju, ovaj algoritam mora da traži od korena stabla do lista najdaljeg od korena, tako da operacija pretrage traje proporcijalno <i>visini</i> stabla. U proseku, binarno stablo pretrage sa <i>n</i> čvorova ima visinu <a href="/wiki/%D0%92%D0%B5%D0%BB%D0%B8%D0%BA%D0%BE_%D0%9E" title="Велико О">O</a> (log <i>n</i>). Ali, u najgorem slučaju, visina može biti i O(<i>n</i>). </p> <div class="mw-heading mw-heading3"><h3 id="Ubacivanje_elementa">Ubacivanje elementa</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=5" title="Уредите одељак „Ubacivanje elementa”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=5" title="Уреди извор одељка: Ubacivanje elementa"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Ubacivanje elementa počinje isto kao i pretraga; ako ključ nije jednak korenu, pretražujemo levo ili desno podstablo ka malopre. Na kraju dolazimo do eksternog čvora i dodajemo novu ključ-vrednost (ovde kao 'newNode') kao njegovo levo ili desno dete, u zavisnosti od vrednosti čvora. </p><p>Evo kako izgleda tipično dodavanje elementa u binarno stablo pretrage u jeziku <a href="/wiki/C%2B%2B" title="C++">C++</a>: </p> <div class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">insert</span><span class="p">(</span><span class="n">Node</span><span class="o">*&</span><span class="w"> </span><span class="n">root</span><span class="p">,</span><span class="w"> </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="p">{</span> <span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">root</span><span class="p">)</span><span class="w"> </span> <span class="w"> </span><span class="n">root</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Node</span><span class="p">(</span><span class="n">data</span><span class="p">);</span> <span class="w"> </span><span class="k">else</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="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">root</span><span class="o">-></span><span class="n">data</span><span class="p">)</span> <span class="w"> </span><span class="n">insert</span><span class="p">(</span><span class="n">root</span><span class="o">-></span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="n">data</span><span class="p">);</span> <span class="w"> </span><span class="k">else</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="w"> </span><span class="o">></span><span class="w"> </span><span class="n">root</span><span class="o">-></span><span class="n">data</span><span class="p">)</span> <span class="w"> </span><span class="n">insert</span><span class="p">(</span><span class="n">root</span><span class="o">-></span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="n">data</span><span class="p">);</span> <span class="w"> </span><span class="k">return</span><span class="p">;</span> <span class="p">}</span> </pre></div> <p>Navedena <i>destruktivna</i> funkcija modifikuje stablo u mestu. Nakon njenog izvršavanja, izgubiće se prethodna verzija stabla. Druga mogućnost je da, kao u sledećem primeru u jeziku Python, rekonstruišemo sve pretke ubačenog čvora; svaka referenca na originalno stablo ostaje validna, i tako je stablo <i>stalna struktura podataka</i>: </p> <div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span></span> <span class="k">def</span> <span class="nf">binary_tree_insert</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> <span class="k">if</span> <span class="n">node</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">TreeNode</span><span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">if</span> <span class="n">key</span> <span class="o">==</span> <span class="n">node</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="k">return</span> <span class="n">TreeNode</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">node</span><span class="o">.</span><span class="n">right</span><span class="p">)</span> <span class="k">if</span> <span class="n">key</span> <span class="o"><</span> <span class="n">node</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="k">return</span> <span class="n">TreeNode</span><span class="p">(</span><span class="n">binary_tree_insert</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="n">node</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">node</span><span class="o">.</span><span class="n">value</span><span class="p">,</span> <span class="n">node</span><span class="o">.</span><span class="n">right</span><span class="p">)</span> <span class="k">else</span><span class="p">:</span> <span class="k">return</span> <span class="n">TreeNode</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">node</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">node</span><span class="o">.</span><span class="n">value</span><span class="p">,</span> <span class="n">binary_tree_insert</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">))</span> </pre></div> <p><br /> Ubacivanje elementa u BSP, zahteva vreme proporcionalno visini stabla u najgorem slučaju, a to je O(<i>n</i>). U prosečnom slučaju, složenost je O(log <i>n</i>). </p> <div class="mw-heading mw-heading3"><h3 id="Brisanje_elementa">Brisanje elementa</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=6" title="Уредите одељак „Brisanje elementa”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=6" title="Уреди извор одељка: Brisanje elementa"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Postoje tri slučaja koje treba razmotriti: </p> <ul><li><b>Brisanje lista (čvora bez dece):</b> Brisanje lista je lako, samo ga izbacujemo iz stabla.</li> <li><b>Brisanje čvora sa jednim detetom:</b> Briše se čvor, i zamenjuje sa svojim detetom.</li> <li><b>Brisanje čvora sa oba deteta:</b> Neka se čvor koji brišemo zove <i>N</i>. Ne brišemo <i>N</i>. Umesto toga, biramo njegovog in-order sledbenika, ili njegovog in-order prethodnka, <i>R</i>. Kopiramo vrednost <i>R</i> u <i>N</i>, i rekurzivno pozovemo brisanje na <i>R</i> dok ne dođemo do nekog od prva dva slučaja.</li></ul> <p>Čvorovi sa decom su teži za brisanje. Kao sa svim binarnim stablima, in-order sledbenik čvora je najlevlji čvor u njegovom desnom podstablu, a njegov in-order prethodnik je najdešnji element u njegovom levom podstablu. Brišemo ga u slkadu sa jednim od dva jednostavina slučaja iznad. </p> <figure class="mw-halign-center" typeof="mw:File/Thumb"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Binary_search_tree_delete.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/4/46/Binary_search_tree_delete.svg/640px-Binary_search_tree_delete.svg.png" decoding="async" width="640" height="182" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/46/Binary_search_tree_delete.svg/960px-Binary_search_tree_delete.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/46/Binary_search_tree_delete.svg/1280px-Binary_search_tree_delete.svg.png 2x" data-file-width="2109" data-file-height="600" /></a><figcaption>Brisanje čvora sa dva deteta iz binarnog stabla pretrage. Prvo nadjemo najdešnji čvor u levom podstablu, in-order prethodnik <b>6</b>. Kopiramo tu vrednost u čvor koji treba da obrišemo. In-order prethodnik se onda može lako obrisati, zato što ima najviše jedno dete. Isti metod radi simetrično za in-order sledbenika <b>9</b>.</figcaption></figure> <p>Ukoliko često koristimo in-order sledbenika ili in-order prethodika za svaki slučaj sa dva deteta, može doći do nebalansiranog stabla, tako da neke implementacije biraju jedan od ta dva slučaja u različitim trenucima. </p> <div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span></span><span class="k">def</span> <span class="nf">find_min</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="c1"># Gets minimum node (leftmost leaf) in a subtree</span> <span class="n">current_node</span> <span class="o">=</span> <span class="bp">self</span> <span class="k">while</span> <span class="n">current_node</span><span class="o">.</span><span class="n">left_child</span><span class="p">:</span> <span class="n">current_node</span> <span class="o">=</span> <span class="n">current_node</span><span class="o">.</span><span class="n">left_child</span> <span class="k">return</span> <span class="n">current_node</span> <span class="k">def</span> <span class="nf">replace_node_in_parent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_value</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> <span class="k">if</span> <span class="bp">self</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">left_child</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">left_child</span> <span class="o">=</span> <span class="n">new_value</span> <span class="k">else</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">right_child</span> <span class="o">=</span> <span class="n">new_value</span> <span class="k">if</span> <span class="n">new_value</span><span class="p">:</span> <span class="n">new_value</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="k">def</span> <span class="nf">binary_tree_delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> <span class="k">if</span> <span class="n">key</span> <span class="o"><</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_child</span><span class="o">.</span><span class="n">binary_tree_delete</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> <span class="k">elif</span> <span class="n">key</span> <span class="o">></span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_child</span><span class="o">.</span><span class="n">binary_tree_delete</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> <span class="k">else</span><span class="p">:</span> <span class="c1"># delete the key here</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_child</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_child</span><span class="p">:</span> <span class="c1"># if both children are present</span> <span class="n">successor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_child</span><span class="o">.</span><span class="n">find_min</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">successor</span><span class="o">.</span><span class="n">key</span> <span class="n">successor</span><span class="o">.</span><span class="n">binary_tree_delete</span><span class="p">(</span><span class="n">successor</span><span class="o">.</span><span class="n">key</span><span class="p">)</span> <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_child</span><span class="p">:</span> <span class="c1"># if the node has only a *left* child</span> <span class="bp">self</span><span class="o">.</span><span class="n">replace_node_in_parent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_child</span><span class="p">)</span> <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_child</span><span class="p">:</span> <span class="c1"># if the node has only a *right* child</span> <span class="bp">self</span><span class="o">.</span><span class="n">replace_node_in_parent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">right_child</span><span class="p">)</span> <span class="k">else</span><span class="p">:</span> <span class="c1"># this node has no children</span> <span class="bp">self</span><span class="o">.</span><span class="n">replace_node_in_parent</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Obilazak_stabla">Obilazak stabla</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=7" title="Уредите одељак „Obilazak stabla”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=7" title="Уреди извор одељка: Obilazak stabla"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Kada je binarno stablno kreirano, možemo vratiti njegove elemente in-order, rekurzivnim obilaskom levog podstabla čvora, pristupom samom čvoru, i onda rekurzivnim obilaskom desnog podstabla čvora, zatim nastavljajući ovaj šablon za svaki čvor nakon što mu rekurzivno pristupimo. Kao sa svim binarnim stablima, imamo i pre-order i post-order obilazak, ali nijedan nije koristan za binarno stablo pretrage. In-order obilazak će uvek vratiti sortiran niz elemenata čvora. </p><p>Kod za in-order obilazak u jeziku Python: </p> <div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span></span><span class="k">def</span> <span class="nf">traverse_binary_tree</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">callback</span><span class="p">):</span> <span class="k">if</span> <span class="n">node</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">traverse_binary_tree</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">leftChild</span><span class="p">,</span> <span class="n">callback</span><span class="p">)</span> <span class="n">callback</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">value</span><span class="p">)</span> <span class="n">traverse_binary_tree</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">rightChild</span><span class="p">,</span> <span class="n">callback</span><span class="p">)</span> </pre></div> <p>Obilazak je složenosti O(<i>n</i>) , zato što se mora obići svaki čvor. </p> <div class="mw-heading mw-heading3"><h3 id="Sortiranje">Sortiranje</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=8" title="Уредите одељак „Sortiranje”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=8" title="Уреди извор одељка: Sortiranje"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Binary_tree_sort(2).png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Binary_tree_sort%282%29.png/220px-Binary_tree_sort%282%29.png" decoding="async" width="220" height="337" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Binary_tree_sort%282%29.png/330px-Binary_tree_sort%282%29.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Binary_tree_sort%282%29.png/440px-Binary_tree_sort%282%29.png 2x" data-file-width="584" data-file-height="894" /></a><figcaption></figcaption></figure> <p>Binarno stablo pretrage se može iskoristiti za implementaciju jednostavnog, ali efikasnog <a href="/wiki/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D0%B8_%D1%81%D0%BE%D1%80%D1%82%D0%B8%D1%80%D0%B0%D1%9A%D0%B0" title="Алгоритми сортирања">algoritma za sortiranje</a>. Slično kao kod <a href="/wiki/Hipsort" title="Hipsort">heap sort-a</a>, ubacujemo sve vrednosti koje želimo da sortiramo u novu strukturu podataka, u ovom slučaju binarno stablo pretrage, i onda ga obiđemo in-order obilaskom, i dobijamo rezultat: </p> <div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span></span><span class="k">def</span> <span class="nf">build_binary_tree</span><span class="p">(</span><span class="n">values</span><span class="p">):</span> <span class="n">tree</span> <span class="o">=</span> <span class="kc">None</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">values</span><span class="p">:</span> <span class="n">tree</span> <span class="o">=</span> <span class="n">binary_tree_insert</span><span class="p">(</span><span class="n">tree</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span> <span class="k">return</span> <span class="n">tree</span> <span class="k">def</span> <span class="nf">get_inorder_traversal</span><span class="p">(</span><span class="n">root</span><span class="p">):</span> <span class="w"> </span><span class="sd">'''</span> <span class="sd"> Returns a list containing all the values in the tree, starting at *root*.</span> <span class="sd"> Traverses the tree in-order(leftChild, root, rightChild).</span> <span class="sd"> '''</span> <span class="n">result</span> <span class="o">=</span> <span class="p">[]</span> <span class="n">traverse_binary_tree</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">element</span><span class="p">:</span> <span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">element</span><span class="p">))</span> <span class="k">return</span> <span class="n">result</span> </pre></div> <p>Najgori slučaj <code>build_binary_tree</code> je <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^{2})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{2})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6cd9594a16cb898b8f2a2dff9227a385ec183392" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.032ex; height:3.176ex;" alt="{\displaystyle O(n^{2})}"></span>—ako mu damo sortirani niz vrednosti, on ih ulanča u povezanu listu bez levog podstabla. Na primer, <code>build_binary_tree([1, 2, 3, 4, 5])</code> stvara stablo tree <code>(1 (2 (3 (4 (5)))))</code>. </p><p>Postoji nekoliko načina za izbegavanje ove mane sa jednostavnim binarnim stablima; najčešća je <a href="/wiki/%D0%A1%D0%B0%D0%BC%D0%BE%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%B0%D1%98%D1%83%D1%9B%D0%B5_%D0%B1%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE_%D0%BF%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B3%D0%B5" title="Самобалансирајуће бинарно стабло претраге">samobalansirajuće binarno stablo pretrage</a>. Ako uradimo istu proceduru koristećo takvo stablo, najgora složenost je O(<i>n</i>log <i>n</i>). </p> <div class="mw-heading mw-heading2"><h2 id="Vrste">Vrste</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=9" title="Уредите одељак „Vrste”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=9" title="Уреди извор одељка: Vrste"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Postoji mnogo vrsta binarnih stabla pretrage. <a href="/wiki/%D0%90%D0%92%D0%9B-%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="АВЛ-стабло">AVL-stabla</a> i <a href="/wiki/%D0%A6%D1%80%D0%B2%D0%B5%D0%BD%D0%BE-%D1%86%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="Црвено-црно стабло">Crveno-crna stabla</a> su oblici <a href="/wiki/%D0%A1%D0%B0%D0%BC%D0%BE%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%B0%D1%98%D1%83%D1%9B%D0%B5_%D0%B1%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE_%D0%BF%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B3%D0%B5" title="Самобалансирајуће бинарно стабло претраге">samobalansirajućeg binarnog stabla pretrage</a>. <a href="/wiki/%D0%A0%D0%B0%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%BE_%D0%B4%D1%80%D0%B2%D0%BE" title="Раширено дрво">Rašireno stablo</a> je binarno stablo pretrage koje automatski pomera elemente kojima se često pristupa bliže korenu. U <a href="/w/index.php?title=Treap&action=edit&redlink=1" class="new" title="Treap (страница не постоји)">Treap-u</a> (<i><a href="/wiki/Hip_(struktura_podataka)" title="Hip (struktura podataka)">heap</a> stablo</i>), svaki čvor čuva i (nasumično izabran) prioritet i roditeljski čvor ima viši prioritet od svoje dece. <a href="/wiki/Tango_stablo" title="Tango stablo">Tango stablo</a> su stabla optimizovana za brzu pretragu. </p><p>Druga dva prideva koja opisuju binarno stablo pretrage su <i>kompletno</i> i <i>degenerisano</i> stablo. </p><p>Kompletno binarno stablo je binarno stablo koje je skroz puno, sa mogućnošću izuzetka donjeg nivoa, koje je napunjeno sa leva na desno. U kompletnom binarnom stablu, svi čvorovi su najlevlje moguće. To je stablo sa n nivoa, gde za svaki nivo d <= n - 1, broj postojećih čvorova na nivou d je jednak 2<sup>d</sup>. Ovo znači da svi mogući čvorovi postoje na ovim nivoima. Dodatan uslov za kompletno binarno stablo je da za n-ti nivo, svi postojeći čvorovi moraju da budu popunjeni s leva na desno. </p><p>Degenerisano stablo je stablo gde za svaki roditeljski čvor, postoji samo jedno dete čvor. Ono je nebalansirano i, u najgorem slučaju, performanse se spuštaju na nivo povezane liste. Ako funkcija za dodavanje čvora ne podržava rebalansiranje, onda se lako može stvoriti degenerisano stablo ako mu dodajemo podatke koji su već sortirani. Ovo znači da u merenju performansi, stablo će se na kraju ponašati kao povezana lista. </p> <div class="mw-heading mw-heading3"><h3 id="Poređenje_performansi"><span id="Pore.C4.91enje_performansi"></span>Poređenje performansi</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=10" title="Уредите одељак „Poređenje performansi”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=10" title="Уреди извор одељка: Poređenje performansi"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>D. A. Heger (2004)<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> je objavio poređenje performansi binarnih stabla pretrage. <a href="/w/index.php?title=Treap&action=edit&redlink=1" class="new" title="Treap (страница не постоји)">Treap</a> ima najbolje performanse u proseku, dok <a href="/wiki/%D0%A6%D1%80%D0%B2%D0%B5%D0%BD%D0%BE-%D1%86%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="Црвено-црно стабло">Crveno-crna stabla</a> ima najmanje variajcija u performansama. </p> <div class="mw-heading mw-heading3"><h3 id="Optimalno_binarno_stablo_pretrage">Optimalno binarno stablo pretrage</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=11" title="Уредите одељак „Optimalno binarno stablo pretrage”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=11" title="Уреди извор одељка: Optimalno binarno stablo pretrage"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure typeof="mw:File/Thumb"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:BinaryTreeRotations.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/BinaryTreeRotations.svg/300px-BinaryTreeRotations.svg.png" decoding="async" width="300" height="166" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/BinaryTreeRotations.svg/450px-BinaryTreeRotations.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/43/BinaryTreeRotations.svg/600px-BinaryTreeRotations.svg.png 2x" data-file-width="405" data-file-height="224" /></a><figcaption>Rotacija stabla je veoma česta interna operacija u binarnim stablima, da bi se održao savršen ili blizak-savršenom, interni balans u stablu.</figcaption></figure> <p>Ako ne želimo da modifikujemo stablo pretrage, i znamo tačno koliko često će se pristupati svakom elementu, možemo da konstruišemo<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> <i>optimalno binarno stablo pretrage</i>, stablo pretrage kod koga je prosečna cena potraživanja elementa minimalizovana. </p><p>Ako ne znamo unapred kojim redom će se pristupati elementima stabla, možemo da koristimo <a href="/w/index.php?title=%D0%A0%D0%B0%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%BE_%D0%B4%D1%80%D0%B2%D0%BE_%C5%BD&action=edit&redlink=1" class="new" title="Раширено дрво Ž (страница не постоји)">Rašireno drvo</a>. </p><p><br /> </p><p><br /> </p><p><b>Primer u Python-u:</b> <b></b> </p><p>import sys import random </p> <ol><li>random list generator</li></ol> <p>def random_list (min, max, elements): </p> <pre> list = random.sample(range(min, max), elements) return list </pre> <ol><li>class for nodes</li></ol> <p>class Node : </p> <pre> def __init__(self, data) : self.p = None self.r = None self.l = None self.data1 = data self.data2 = str(data) </pre> <ol><li>tree class</li></ol> <p>class Tree : </p> <pre> #root is only field #constructor def __init__(self) : self.root = None </pre> <pre> #method for adding nodes to tree def add(self, val) : #same as insert method from PDF if(self.root == None) : self.root = Node(val) else : self._add(val, self.root) </pre> <pre> #side method for recursive adding def _add(self, val, node) : #if less add it to left side if(val < node.data1) : if(node.l != None) : self._add(val, node.l) else : node.l = Node(val) node.l.p = node #if val is greater add it to right side else : if(node.r != None) : self._add(val, node.r) else : node.r = Node(val) node.r.p = node </pre> <pre> #In-Order-Walk def in_order_walk(self, node) : if(node != None) : self.in_order_walk(node.l) print("print node data : ", node.data1, node.data2) self.in_order_walk(node.r) </pre> <pre> #Print-root def print_root(self) : print("Data in root node", self.root.data1, self.root.data2) </pre> <pre> #Search the tree for wanted key def tree_search(self, current, key) : if (current == None or key == current.data1) : return current if (key < current.data1) : return self.tree_search(current.l, key) else : return self.tree_search(current.r, key) </pre> <pre> #Search the tree for wanted key iterative way def iterative_tree_search(self, current, key) : while (current != None and key != current.data1) : if (key < current.data1) : current = current.l else : current = current.r return current </pre> <pre> #Find the tree minimum def tree_minimum(self, node) : while (node.l != None) : node = node.l return node </pre> <pre> #Find tree maximum def tree_maximum(self, node) : while(node.r != None) : node = node.r return node </pre> <pre> #Print node's parent def print_parrent(self, node) : if (node.p != None) : print("Parent node of node ", node.data1, "is", node.p.data1) else : print("The node ", node.data1, "is root") </pre> <pre> #Transplant def transplant(self, u, v) : if (u.p == None) : self.root = v elif (u == u.p.l) : u.p.l = v else : u.p.r = v if (v != None) : v.p = u.p </pre> <pre> #Deleting node def delete(self, node) : if (node.l == None) : self.transplant(node, node.r) elif (node.r == None) : self.transplant(node, node.l) else : y = self.tree_minimum(node.r) if (y.p != z) : self.transplant(y, y.r) y.r = node.r y.r.p = y self.transplant(node, y) y.l = node.l y.l.p = y </pre> <pre> #In-Order-Walk-With-RetVal def in_order_walk_with_retval(self, node) : global x if(node != None) : self.in_order_walk_with_retval(node.l) x.append(node) self.in_order_walk_with_retval(node.r) </pre> <ol><li>Testiranje</li></ol> <p>x = list() </p> <ol><li>Testing here</li></ol> <p>tree = Tree(); A = random_list(0, 20, 10) print(A) key = A[9] key_i = A[6] key_invalid = 100 </p><p>for i in range(0, len(A)) : </p> <pre> tree.add(A[i]) </pre> <p>tree.print_root() </p> <ol><li>testing in order walk</li></ol> <p>tree.in_order_walk(tree.root) </p> <ol><li>testing tree search</li></ol> <p>f_k = tree.tree_search(tree.root, key) if (f_k != None) : </p> <pre> print("Found the key", f_k.data1, "and we searched for ", key) </pre> <p>else : </p> <pre> print("No key", key, "found") </pre> <p>f_k = tree.tree_search(tree.root, key_invalid) if (f_k != None) : </p> <pre> print("Found the key", f_k.data1, "and we searched for ", key_invalid) </pre> <p>else : </p> <pre> print("No key", key_invalid, "found") </pre> <p><br /> </p> <ol><li>testing iterative search</li></ol> <p>f_k_i = tree.iterative_tree_search(tree.root, key_i) if (f_k_i != None) : </p> <pre> print("Found the key", f_k_i.data1, "and we searched for ", key_i) </pre> <p>else : </p> <pre> print("No key", key_i, "found") </pre> <ol><li>testing tree minimum</li></ol> <p>temp = tree.tree_minimum(tree.root) print("Tree minimum", temp.data1) </p> <ol><li>testing tree maximum</li></ol> <p>temp = tree.tree_maximum(tree.root) print("Tree minimum", temp.data1) </p> <ol><li>testing print parent</li></ol> <p>tree.print_parrent(temp) tree.print_parrent(tree.root) </p> <ol><li>Testing inserting</li></ol> <p>print("Inserting 110 and -5 to tree") tree.add(110) tree.add(-5) tree.in_order_walk(tree.root) </p> <ol><li>testing tree minimum</li></ol> <p>temp = tree.tree_minimum(tree.root) print("Tree minimum", temp.data1) </p> <ol><li>testing tree maximum</li></ol> <p>temp = tree.tree_maximum(tree.root) print("Tree minimum", temp.data1) </p> <ol><li>testing print parent</li></ol> <p>tree.print_parrent(temp) </p> <ol><li>Trying to delete maximum</li></ol> <p>temp = tree.tree_maximum(tree.root) tree.delete(temp) print("Tree after deleting max") tree.in_order_walk(tree.root) </p> <ol><li>Trying to delete minimum</li></ol> <p>temp = tree.tree_minimum(tree.root) tree.delete(temp) print("Tree after deleting min") tree.in_order_walk(tree.root) </p><p>print("########") </p><p>tree.in_order_walk_with_retval(tree.root) </p><p><br /> for i in x : </p> <pre> print(i.data1) </pre> <p><br /> </p><p><br /> </p><p><br /> </p> <div style="clear:both;"></div> <div class="mw-heading mw-heading2"><h2 id="Vidi_još"><span id="Vidi_jo.C5.A1"></span>Vidi još</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=12" title="Уредите одељак „Vidi još”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=12" title="Уреди извор одељка: Vidi još"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <div style="-moz-column-count:2; column-count:2;"> <ul><li><a href="/wiki/%D0%A1%D0%B0%D0%BC%D0%BE%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%B0%D1%98%D1%83%D1%9B%D0%B5_%D0%B1%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE_%D0%BF%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B3%D0%B5" title="Самобалансирајуће бинарно стабло претраге">Samobalansirajuće binarno stablo pretrage</a></li> <li><a href="/wiki/%D0%91%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%B0_%D0%BF%D1%80%D0%B5%D1%82%D1%80%D0%B0%D0%B3%D0%B0" title="Бинарна претрага">Binarna pretraga</a></li> <li><a href="/w/index.php?title=Treap&action=edit&redlink=1" class="new" title="Treap (страница не постоји)">Treap</a></li> <li><a href="/wiki/Tango_stablo" title="Tango stablo">Tango stablo</a></li> <li><a href="/wiki/%D0%A6%D1%80%D0%B2%D0%B5%D0%BD%D0%BE-%D1%86%D1%80%D0%BD%D0%BE_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="Црвено-црно стабло">Црвено-црно стабло</a></li> <li><a href="/wiki/%D0%90%D0%92%D0%9B-%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%BE" title="АВЛ-стабло">АВЛ-стабло</a></li></ul> </div> <div class="mw-heading mw-heading2"><h2 id="Reference">Reference</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=13" title="Уредите одељак „Reference”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=13" title="Уреди извор одељка: Reference"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r28440201">.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><cite id="CITEREFGilbergForouzan2001" class="citation">Gilberg, R.; Forouzan, B. (2001), „8”, <i>Data Structures: A Pseudocode Approach With C++</i>, Pacific Grove, CA: Brooks/Cole, стр. 339, <a href="/wiki/Me%C4%91unarodni_standardni_broj_knjige" title="Međunarodni standardni broj knjige">ISBN</a> <a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A8%D1%82%D0%B0%D0%BC%D0%BF%D0%B0%D0%BD%D0%B8_%D0%B8%D0%B7%D0%B2%D0%BE%D1%80%D0%B8/978-0-534-95216-7" title="Посебно:Штампани извори/978-0-534-95216-7">978-0-534-95216-7</a></cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=8&rft.au=Forouzan%2C+B.&rft.aufirst=R.&rft.aulast=Gilberg&rft.btitle=Data+Structures%3A+A+Pseudocode+Approach+With+C%2B%2B&rft.date=2001&rft.genre=bookitem&rft.isbn=978-0-534-95216-7&rft.pages=339&rft.place=Pacific+Grove%2C+CA&rft.pub=Brooks%2FCole&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFHeger2004" class="citation">Heger, Dominique A. (2004), <a rel="nofollow" class="external text" href="https://web.archive.org/web/20140327140251/http://www.cepis.org/upgrade/files/full-2004-V.pdf">„A Disquisition on The Performance Behavior of Binary Search Tree Data Structures”</a> <span style="font-size:85%;">(PDF)</span>, <i>European Journal for the Informatics Professional</i>, <b>5</b> (5): 67—75, Архивирано из <a rel="nofollow" class="external text" href="http://www.cepis.org/upgrade/files/full-2004-V.pdf">оригинала</a> <span style="font-size:85%;">(PDF)</span> 27. 03. 2014. г.<span class="reference-accessdate">, Приступљено <span class="nowrap">20. 04. 2014</span></span></cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=A+Disquisition+on+The+Performance+Behavior+of+Binary+Search+Tree+Data+Structures&rft.aufirst=Dominique+A.&rft.aulast=Heger&rft.date=2004&rft.genre=article&rft.issue=5&rft.jtitle=European+Journal+for+the+Informatics+Professional&rft.pages=67-75&rft.volume=5&rft_id=http%3A%2F%2Fwww.cepis.org%2Fupgrade%2Ffiles%2Ffull-2004-V.pdf&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></span> </li> <li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web">Gonnet, Gaston. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20020830091706/http://linneus20.ethz.ch:8080/4_7_1.html">„Optimal Binary Search Trees”</a>. <i>Scientific Computation</i>. ETH Zürich. Архивирано из <a rel="nofollow" class="external text" href="http://linneus20.ethz.ch:8080/4_7_1.html">оригинала</a> 30. 08. 2002. г<span class="reference-accessdate">. Приступљено <span class="nowrap">1. 12. 2013</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Optimal+Binary+Search+Trees&rft.aufirst=Gaston&rft.aulast=Gonnet&rft.genre=unknown&rft.jtitle=Scientific+Computation&rft_id=http%3A%2F%2Flinneus20.ethz.ch%3A8080%2F4_7_1.html&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="Literatura">Literatura</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=14" title="Уредите одељак „Literatura”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=14" title="Уреди извор одељка: Literatura"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>Paul E. Black, <a rel="nofollow" class="external text" href="http://www.nist.gov/dads/HTML/binarySearchTree.html">Binary Search Tree</a> at the National Institute of Standards and Technology, Dictionary of Algorithms and Data Structures.</li> <li><cite id="CITEREFCormenLeisersonRivestStein2001" class="citation book"><a href="/w/index.php?title=Thomas_H._Cormen&action=edit&redlink=1" class="new" title="Thomas H. Cormen (страница не постоји)">Cormen, Thomas H.</a>; <a href="/w/index.php?title=Charles_E._Leiserson&action=edit&redlink=1" class="new" title="Charles E. Leiserson (страница не постоји)">Leiserson, Charles E.</a>; <a href="/wiki/Ronald_L._Rivest" class="mw-redirect" title="Ronald L. Rivest">Rivest, Ronald L.</a>; <a href="/w/index.php?title=Clifford_Stein&action=edit&redlink=1" class="new" title="Clifford Stein (страница не постоји)">Stein, Clifford</a> (2001). „12: Binary search trees, 15.5: Optimal binary search trees”. <i><a href="/w/index.php?title=Introduction_to_Algorithms&action=edit&redlink=1" class="new" title="Introduction to Algorithms (страница не постоји)">Introduction to Algorithms</a></i> (2nd изд.). MIT Press & McGraw-Hill. стр. <a rel="nofollow" class="external text" href="https://archive.org/details/introductiontoal00corm_691/page/n275">253</a>–272,356–363. <a href="/wiki/Me%C4%91unarodni_standardni_broj_knjige" title="Međunarodni standardni broj knjige">ISBN</a> <a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A8%D1%82%D0%B0%D0%BC%D0%BF%D0%B0%D0%BD%D0%B8_%D0%B8%D0%B7%D0%B2%D0%BE%D1%80%D0%B8/978-0-262-03293-3" title="Посебно:Штампани извори/978-0-262-03293-3">978-0-262-03293-3</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=12%3A+Binary+search+trees%2C+15.5%3A+Optimal+binary+search+trees&rft.au=Leiserson%2C+Charles+E.&rft.au=Rivest%2C+Ronald+L.&rft.au=Stein%2C+Clifford&rft.aufirst=Thomas+H.&rft.aulast=Cormen&rft.btitle=Introduction+to+Algorithms&rft.date=2001&rft.edition=2nd&rft.genre=bookitem&rft.isbn=978-0-262-03293-3&rft.pages=253-272%2C356-363&rft.pub=MIT+Press+%26+McGraw-Hill&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite class="citation web">Jarc, Duane J. (3. 12. 2005). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20140227082917/http://nova.umuc.edu/~jarc/idsv/lesson1.html">„Binary Tree Traversals”</a>. <i>Interactive Data Structure Visualizations</i>. <a href="/w/index.php?title=University_of_Maryland&action=edit&redlink=1" class="new" title="University of Maryland (страница не постоји)">University of Maryland</a>. Архивирано из <a rel="nofollow" class="external text" href="http://nova.umuc.edu/~jarc/idsv/lesson1.html">оригинала</a> 27. 02. 2014. г<span class="reference-accessdate">. Приступљено <span class="nowrap">20. 04. 2014</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Binary+Tree+Traversals&rft.aufirst=Duane+J.&rft.aulast=Jarc&rft.date=2005-12-03&rft.genre=unknown&rft.jtitle=Interactive+Data+Structure+Visualizations&rft_id=http%3A%2F%2Fnova.umuc.edu%2F~jarc%2Fidsv%2Flesson1.html&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite id="CITEREFKnuth1997" class="citation book"><a href="/wiki/Donald_Knuth" class="mw-redirect" title="Donald Knuth">Knuth, Donald</a> (1997). „6.2.2: Binary Tree Searching”. <i><a href="/w/index.php?title=The_Art_of_Computer_Programming&action=edit&redlink=1" class="new" title="The Art of Computer Programming (страница не постоји)">The Art of Computer Programming</a></i>. 3: "Sorting and Searching" (3rd изд.). Addison-Wesley. стр. 426—458. <a href="/wiki/Me%C4%91unarodni_standardni_broj_knjige" title="Međunarodni standardni broj knjige">ISBN</a> <a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%A8%D1%82%D0%B0%D0%BC%D0%BF%D0%B0%D0%BD%D0%B8_%D0%B8%D0%B7%D0%B2%D0%BE%D1%80%D0%B8/978-0-201-89685-5" title="Посебно:Штампани извори/978-0-201-89685-5">978-0-201-89685-5</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=6.2.2%3A+Binary+Tree+Searching&rft.aufirst=Donald&rft.aulast=Knuth&rft.btitle=The+Art+of+Computer+Programming&rft.date=1997&rft.edition=3rd&rft.genre=bookitem&rft.isbn=978-0-201-89685-5&rft.pages=426-458&rft.pub=Addison-Wesley&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite class="citation web">Long, Sean. <a rel="nofollow" class="external text" href="http://employees.oneonta.edu/zhangs/PowerPointPlatform/resources/samples/binarysearchtree.ppt">„Binary Search Tree”</a> <span style="font-size:85%;">(<a href="/wiki/%D0%9C%D0%B0%D1%98%D0%BA%D1%80%D0%BE%D1%81%D0%BE%D1%84%D1%82_%D0%BF%D0%B0%D1%83%D0%B5%D1%80%D0%BF%D0%BE%D1%98%D0%BD%D1%82" class="mw-redirect" title="Мајкрософт пауерпојнт">PPT</a>)</span>. <i>Data Structures and Algorithms Visualization-A PowerPoint Slides Based Approach</i>. <a href="/w/index.php?title=SUNY_Oneonta&action=edit&redlink=1" class="new" title="SUNY Oneonta (страница не постоји)">SUNY Oneonta</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Binary+Search+Tree&rft.aufirst=Sean&rft.aulast=Long&rft.genre=unknown&rft.jtitle=Data+Structures+and+Algorithms+Visualization-A+PowerPoint+Slides+Based+Approach&rft_id=http%3A%2F%2Femployees.oneonta.edu%2Fzhangs%2FPowerPointPlatform%2Fresources%2Fsamples%2Fbinarysearchtree.ppt&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite class="citation web">Parlante, Nick (2001). <a rel="nofollow" class="external text" href="http://cslibrary.stanford.edu/110/BinaryTrees.html">„Binary Trees”</a>. <i>CS Education Library</i>. <a href="/wiki/Univerzitet_Stanford" title="Univerzitet Stanford">Stanford University</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Binary+Trees&rft.aufirst=Nick&rft.aulast=Parlante&rft.date=2001&rft.genre=unknown&rft.jtitle=CS+Education+Library&rft_id=http%3A%2F%2Fcslibrary.stanford.edu%2F110%2FBinaryTrees.html&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></li></ul> <div class="mw-heading mw-heading2"><h2 id="Spoljašnje_veze"><span id="Spolja.C5.A1nje_veze"></span>Spoljašnje veze</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Binarno_stablo_pretrage&veaction=edit&section=15" title="Уредите одељак „Spoljašnje veze”" class="mw-editsection-visualeditor"><span>уреди</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Binarno_stablo_pretrage&action=edit&section=15" title="Уреди извор одељка: Spoljašnje veze"><span>уреди извор</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r25554621">.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}}@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"><style data-mw-deduplicate="TemplateStyles:r25554968">.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}</style> <div class="side-box-flex"> <div class="side-box-image"><span class="noviewer" typeof="mw:File"><span><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" /></span></span></div> <div class="side-box-text plainlist"><span style="font-weight:bold; font-style: italic;"><a href="https://commons.wikimedia.org/wiki/Category:Binary_search_trees" class="extiw" title="commons:Category:Binary search trees">Binarno stablo pretrage</a></span> на <a href="https://commons.wikimedia.org/wiki/%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B0" class="extiw" title="commons:Главна страна">Викимедијиној остави</a>.</div></div> </div> <ul><li><a rel="nofollow" class="external text" href="http://en.literateprograms.org/Category:Binary_search_tree">Literate implementations of binary search trees in various languages</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20170421105424/http://en.literateprograms.org/Category:Binary_search_tree">Архивирано</a> на сајту <a href="/wiki/Wayback_Machine" title="Wayback Machine">Wayback Machine</a> (21. април 2017) on LiteratePrograms</li> <li><cite class="citation web">Goleta, Maksim (27. 11. 2007). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20140421082638/http://goletas.com/csharp-collections/">„Goletas.Collections”</a>. <i>goletas.com</i>. Архивирано из <a rel="nofollow" class="external text" href="http://goletas.com/csharp-collections/">оригинала</a> 21. 04. 2014. г<span class="reference-accessdate">. Приступљено <span class="nowrap">20. 04. 2014</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Goletas.Collections&rft.aufirst=Maksim&rft.aulast=Goleta&rft.date=2007-11-27&rft.genre=unknown&rft.jtitle=goletas.com&rft_id=http%3A%2F%2Fgoletas.com%2Fcsharp-collections%2F&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span> Includes an iterative <a href="/wiki/C_Sharp_(programming_language)" class="mw-redirect" title="C Sharp (programming language)">C#</a> implementation of AVL trees.</li> <li><cite class="citation web">Jansens, Dana. <a rel="nofollow" class="external text" href="http://cg.scs.carleton.ca/~dana/pbst">„Persistent Binary Search Trees”</a>. Computational Geometry Lab, School of Computer Science, <a href="/w/index.php?title=Carleton_University&action=edit&redlink=1" class="new" title="Carleton University (страница не постоји)">Carleton University</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.aufirst=Dana&rft.aulast=Jansens&rft.btitle=Persistent+Binary+Search+Trees&rft.genre=unknown&rft.pub=Computational+Geometry+Lab%2C+School+of+Computer+Science%2C+Carleton+University&rft_id=http%3A%2F%2Fcg.scs.carleton.ca%2F~dana%2Fpbst&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span> C implementation using <a href="/w/index.php?title=GLib&action=edit&redlink=1" class="new" title="GLib (страница не постоји)">GLib</a>.</li> <li><a rel="nofollow" class="external text" href="http://btv.melezinek.cz">Binary Tree Visualizer</a> (JavaScript animation of various BT-based data structures)</li> <li><cite class="citation web">Kovac, Kubo. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20180430045919/https://people.ksp.sk/~kuko/bak/">„Binary Search Trees”</a>. Korešpondenčný seminár z programovania. Архивирано из <a rel="nofollow" class="external text" href="http://people.ksp.sk/~kuko/bak/">оригинала</a> <span style="font-size:85%;">(<a href="/w/index.php?title=Java_applet&action=edit&redlink=1" class="new" title="Java applet (страница не постоји)">Java applet</a>)</span> 30. 04. 2018. г<span class="reference-accessdate">. Приступљено <span class="nowrap">20. 04. 2014</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.aufirst=Kubo&rft.aulast=Kovac&rft.btitle=Binary+Search+Trees&rft.genre=unknown&rft.pub=Kore%C5%A1ponden%C4%8Dn%C3%BD+semin%C3%A1r+z+programovania&rft_id=http%3A%2F%2Fpeople.ksp.sk%2F~kuko%2Fbak%2F&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite class="citation web">Madru, Justin (18. 8. 2009). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20100328221436/http://jdserver.homelinux.org/wiki/Binary_Search_Tree">„Binary Search Tree”</a>. <i>JDServer</i>. Архивирано из <a rel="nofollow" class="external text" href="http://jdserver.homelinux.org/wiki/Binary_Search_Tree">оригинала</a> 28. 03. 2010. г<span class="reference-accessdate">. Приступљено <span class="nowrap">20. 04. 2014</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Binary+Search+Tree&rft.aufirst=Justin&rft.aulast=Madru&rft.date=2009-08-18&rft.genre=unknown&rft.jtitle=JDServer&rft_id=http%3A%2F%2Fjdserver.homelinux.org%2Fwiki%2FBinary_Search_Tree&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span> C++ implementation.</li> <li><cite class="citation web">Tarreau, Willy (2011). <a rel="nofollow" class="external text" href="http://1wt.eu/articles/ebtree/">„Elastic Binary Trees (ebtree)”</a>. <i>1wt.eu</i>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=Elastic+Binary+Trees+%28ebtree%29&rft.aufirst=Willy&rft.aulast=Tarreau&rft.date=2011&rft.genre=unknown&rft.jtitle=1wt.eu&rft_id=http%3A%2F%2F1wt.eu%2Farticles%2Febtree%2F&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span></li> <li><a rel="nofollow" class="external text" href="http://code.activestate.com/recipes/286239/">Binary Search Tree Example in Python</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20100311192315/http://code.activestate.com/recipes/286239/">Архивирано</a> на сајту <a href="/wiki/Wayback_Machine" title="Wayback Machine">Wayback Machine</a> (11. март 2010)</li> <li><cite class="citation web"><a rel="nofollow" class="external text" href="http://msdn.microsoft.com/en-us/library/1sf8shae%28v=vs.80%29.aspx">„References to Pointers (C++)”</a>. <i><a href="/w/index.php?title=MSDN&action=edit&redlink=1" class="new" title="MSDN (страница не постоји)">MSDN</a></i>. <a href="/wiki/Majkrosoft" class="mw-redirect" title="Majkrosoft">Microsoft</a>. 2005.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.atitle=References+to+Pointers+%28C%2B%2B%29&rft.date=2005&rft.genre=unknown&rft.jtitle=MSDN&rft_id=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2F1sf8shae%2528v%3Dvs.80%2529.aspx&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal" class="Z3988"><span style="display:none;"> </span></span> Gives an example binary tree implementation.</li> <li><cite class="citation web">Igushev, Eduard. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20130617203957/http://igushev.com/implementations/binary-search-tree-cpp/">„Binary Search Tree C++ implementation”</a>. Архивирано из <a rel="nofollow" class="external text" href="http://igushev.com/implementations/binary-search-tree-cpp/">оригинала</a> 17. 06. 2013. г<span class="reference-accessdate">. Приступљено <span class="nowrap">20. 04. 2014</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.aufirst=Eduard&rft.aulast=Igushev&rft.btitle=Binary+Search+Tree+C%2B%2B+implementation&rft.genre=unknown&rft_id=http%3A%2F%2Figushev.com%2Fimplementations%2Fbinary-search-tree-cpp%2F&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></li> <li><cite class="citation web">Stromberg, Daniel. <a rel="nofollow" class="external text" href="http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/">„Python Search Tree Empirical Performance Comparison”</a>.</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fsr.wikipedia.org%3ABinarno+stablo+pretrage&rft.aufirst=Daniel&rft.aulast=Stromberg&rft.btitle=Python+Search+Tree+Empirical+Performance+Comparison&rft.genre=unknown&rft_id=http%3A%2F%2Fstromberg.dnsalias.org%2F~strombrg%2Fpython-tree-and-heap-comparison%2F&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span></li></ul> <!-- NewPP limit report Parsed by mw‐api‐int.codfw.main‐648bd44df8‐jm5qs Cached time: 20241116220831 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.405 seconds Real time usage: 0.619 seconds Preprocessor visited node count: 1607/1000000 Post‐expand include size: 45391/2097152 bytes Template argument size: 6889/2097152 bytes Highest expansion depth: 52/100 Expensive parser function count: 5/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 22007/5000000 bytes Lua time usage: 0.209/10.000 seconds Lua memory usage: 4352441/52428800 bytes Number of Wikibase entities loaded: 1/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 405.822 1 -total 78.82% 319.879 31 Шаблон:Replace 24.81% 100.697 1 Шаблон:Reflist 21.34% 86.594 1 Шаблон:Commonscat 19.07% 77.373 12 Шаблон:Cite_web 15.18% 61.586 2 Шаблон:Citation 13.41% 54.424 1 Шаблон:Категорија_на_Остави/праћење 13.09% 53.114 1 Шаблон:Neprovereni_seminarski 12.03% 48.837 1 Шаблон:Tmbox 9.16% 37.161 2 Шаблон:Wayback --> <!-- Saved in parser cache with key srwiki:pcache:idhash:923467-0!canonical!sr and timestamp 20241116220831 and revision id 28057103. 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&useformat=desktop" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Преузето из „<a dir="ltr" href="https://sr.wikipedia.org/w/index.php?title=Binarno_stablo_pretrage&oldid=28057103">https://sr.wikipedia.org/w/index.php?title=Binarno_stablo_pretrage&oldid=28057103</a>”</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B5" title="Посебно:Категорије">Категорије</a>: <ul><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%91%D0%B8%D0%BD%D0%B0%D1%80%D0%BD%D0%B0_%D1%81%D1%82%D0%B0%D0%B1%D0%BB%D0%B0" title="Категорија:Бинарна стабла">Бинарна стабла</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A1%D1%82%D0%B0%D0%B1%D0%BB%D0%B0_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B5_%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0)" title="Категорија:Стабла (структуре података)">Стабла (структуре података)</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A2%D0%B8%D0%BF%D0%BE%D0%B2%D0%B8_%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0" title="Категорија:Типови података">Типови података</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Сакривене категорије: <ul><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:Pages_using_deprecated_source_tags" title="Категорија:Pages using deprecated source tags">Pages using deprecated source tags</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%9D%D0%B5%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B5%D0%BD%D0%B8_%D1%81%D0%B5%D0%BC%D0%B8%D0%BD%D0%B0%D1%80%D1%81%D0%BA%D0%B8_%D1%80%D0%B0%D0%B4%D0%BE%D0%B2%D0%B8" title="Категорија:Непроверени семинарски радови">Непроверени семинарски радови</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0_%D0%BD%D0%B0_%D0%9E%D1%81%D1%82%D0%B0%D0%B2%D0%B8/%D0%BF%D0%B0%D1%80%D0%B0%D0%BC%D0%B5%D1%82%D0%B0%D1%80/%D0%BD%D0%B5%D0%BD%D0%B0%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD/%D0%B8%D0%BC%D0%B5_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B5_%D1%80%D0%B0%D0%B7%D0%BB%D0%B8%D1%87%D0%B8%D1%82%D0%BE_%D0%BE%D0%B4_%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0" title="Категорија:Шаблон:Категорија на Остави/параметар/ненаведен/име странице различито од Википодатака">Шаблон:Категорија на Остави/параметар/ненаведен/име странице различито од Википодатака</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0_%D0%BD%D0%B0_%D0%9E%D1%81%D1%82%D0%B0%D0%B2%D0%B8/%D0%B8%D0%BC%D0%B5%D0%BD%D1%81%D0%BA%D0%B8_%D0%BF%D1%80%D0%BE%D1%81%D1%82%D0%BE%D1%80/%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B8" title="Категорија:Шаблон:Категорија на Остави/именски простор/главни">Шаблон:Категорија на Остави/именски простор/главни</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A7%D0%BB%D0%B0%D0%BD%D1%86%D0%B8_%D1%81%D0%B0_%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D0%B8%D0%BC%D0%B0_C%2B%2B_%D0%BA%D0%BE%D0%B4%D0%B0" title="Категорија:Чланци са примерима C++ кода">Чланци са примерима C++ кода</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A7%D0%BB%D0%B0%D0%BD%D1%86%D0%B8_%D1%81%D0%B0_%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D0%B8%D0%BC%D0%B0_%D0%88%D0%B0%D0%B2%D0%B0_%D0%BA%D0%BE%D0%B4%D0%B0" title="Категорија:Чланци са примерима Јава кода">Чланци са примерима Јава кода</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:%D0%A7%D0%BB%D0%B0%D0%BD%D1%86%D0%B8_%D1%81%D0%B0_%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D0%B8%D0%BC%D0%B0_%D0%9F%D0%B0%D1%98%D1%82%D0%BE%D0%BD_%D0%BA%D0%BE%D0%B4%D0%B0" title="Категорија:Чланци са примерима Пајтон кода">Чланци са примерима Пајтон кода</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"> Датум и време последње измене странице: 18. јул 2024. у 10:44.</li> <li id="footer-info-copyright">Текст је доступан под лиценцом <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Ауторство—Делити под истим условима</a>; могући су и додатни услови. Погледајте <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">услове коришћења</a> за детаље.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Политика приватности</a></li> <li id="footer-places-about"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%9E_%D0%BD%D0%B0%D0%BC%D0%B0">О Википедији</a></li> <li id="footer-places-disclaimers"><a href="/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%9E%D0%B4%D1%80%D0%B8%D1%86%D0%B0%D1%9A%D0%B5_%D0%BE%D0%B4%D0%B3%D0%BE%D0%B2%D0%BE%D1%80%D0%BD%D0%BE%D1%81%D1%82%D0%B8">Одрицање одговорности</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Кодекс понашања</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">За програмере</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/sr.wikipedia.org">Статистика</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Изјава о колачићима</a></li> <li id="footer-places-mobileview"><a href="//sr.m.wikipedia.org/w/index.php?title=Binarno_stablo_pretrage&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Мобилни приказ</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-6d94db5ff4-z8hzl","wgBackendResponseTime":165,"wgPageParseReport":{"limitreport":{"cputime":"0.405","walltime":"0.619","ppvisitednodes":{"value":1607,"limit":1000000},"postexpandincludesize":{"value":45391,"limit":2097152},"templateargumentsize":{"value":6889,"limit":2097152},"expansiondepth":{"value":52,"limit":100},"expensivefunctioncount":{"value":5,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":22007,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 405.822 1 -total"," 78.82% 319.879 31 Шаблон:Replace"," 24.81% 100.697 1 Шаблон:Reflist"," 21.34% 86.594 1 Шаблон:Commonscat"," 19.07% 77.373 12 Шаблон:Cite_web"," 15.18% 61.586 2 Шаблон:Citation"," 13.41% 54.424 1 Шаблон:Категорија_на_Остави/праћење"," 13.09% 53.114 1 Шаблон:Neprovereni_seminarski"," 12.03% 48.837 1 Шаблон:Tmbox"," 9.16% 37.161 2 Шаблон:Wayback"]},"scribunto":{"limitreport-timeusage":{"value":"0.209","limit":"10.000"},"limitreport-memusage":{"value":4352441,"limit":52428800}},"cachereport":{"origin":"mw-api-int.codfw.main-648bd44df8-jm5qs","timestamp":"20241116220831","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Binarno stablo pretrage","url":"https:\/\/sr.wikipedia.org\/wiki\/Binarno_stablo_pretrage","sameAs":"http:\/\/www.wikidata.org\/entity\/Q623818","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q623818","author":{"@type":"Organization","name":"\u0421\u0430\u0440\u0430\u0434\u043d\u0438\u0446\u0438 \u043f\u0440\u043e\u0458\u0435\u043a\u0430\u0442\u0430 \u0412\u0438\u043a\u0438\u043c\u0435\u0434\u0438\u0458\u0435"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2014-04-20T10:51:42Z","dateModified":"2024-07-18T09:44:52Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/d\/da\/Binary_search_tree.svg"}</script> </body> </html>