{"id":6449,"date":"2025-12-15T12:37:39","date_gmt":"2025-12-15T07:07:39","guid":{"rendered":"https:\/\/study.madeeasy.in\/?p=6449"},"modified":"2025-12-15T12:37:39","modified_gmt":"2025-12-15T07:07:39","slug":"binary-trees-and-types","status":"publish","type":"post","link":"https:\/\/www.madeeasy.in\/study\/cs-it\/binary-trees-and-types","title":{"rendered":"Binary Trees and Types"},"content":{"rendered":"<h2 style=\"text-align: justify;\">Binary Tree<\/h2>\n<ul style=\"text-align: justify;\">\n<li>A binary tree is the one where each node has atmost 2 children.<\/li>\n<li>A binary tree is a finite set of elements that is either empty or is partitioned into three disjoint subsets.<\/li>\n<li>The first subset contains a single element called the root<br \/>\nroot of the tree.<\/li>\n<li>The other two subsets are themselves binary trees, called the left and right subtrees of the original tree.<\/li>\n<li>Each element of a binary tree is called a node of the tree.<\/li>\n<\/ul>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/binary-trees-and-types\/#Types-of-Binary-Trees\" >Types of Binary Trees<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/binary-trees-and-types\/#Strictly-Binary-Tree\" >Strictly Binary Tree<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/binary-trees-and-types\/#Complete-Binary-Tree\" >Complete Binary Tree<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/binary-trees-and-types\/#Almost-Complete-Binary-Tree\" >Almost Complete Binary Tree<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Types-of-Binary-Trees\"><\/span>Types of Binary Trees<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Strictly-Binary-Tree\"><\/span>Strictly Binary Tree<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul style=\"text-align: justify;\">\n<li>If every non leaf node in a binary tree has non empty left and right substrees, the tree is termed as strictly binary tree<\/li>\n<li>Every non-leaf node has degree 2.<\/li>\n<\/ul>\n<h4 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Complete-Binary-Tree\"><\/span>Complete Binary Tree<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul style=\"text-align: justify;\">\n<li>A complete binary tree of depth d is the strictly binary tree &#8211; all of whose leaves are at level d.<\/li>\n<li>A complete binary tree of depth d is the binary tree of depth d that contains exactly 2l nodes at each level l between 0 and d<\/li>\n<\/ul>\n<h4 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Almost-Complete-Binary-Tree\"><\/span>Almost Complete Binary Tree<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li style=\"text-align: justify;\">A binary tree of depth d is an almost complete binary tree if: is an almost complete binary tree if: At any node in the tree with a right descendent at level d, node must have a left son and every left descendent of node is either a leaf at level d or has two sons i.e., the tree must be left filled.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Binary Tree A binary tree is the one where each node has atmost 2 children. A binary tree is a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,94],"tags":[1905,1907,1906],"class_list":["post-6449","post","type-post","status-publish","format-standard","hentry","category-cs-it","category-operating-system","tag-binary-trees","tag-complete-binary-tree","tag-strictly-binary-tree"],"_links":{"self":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/comments?post=6449"}],"version-history":[{"count":0,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6449\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/media?parent=6449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/categories?post=6449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/tags?post=6449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}