From 6be246ac4a7c652d8128ed77c6199a029137fa58 Mon Sep 17 00:00:00 2001 From: Anas Salam <38077746+anassalam@users.noreply.github.com> Date: Thu, 7 Mar 2019 01:43:13 +0500 Subject: [PATCH] inserted text 'aka Parent Node' to the file "index.md" (#26929) * Update file "index.md" added text = 'aka Parent Node' increased branch length from the root * text replaced in index.md file text 'aka' replaced with 'also known as' in index.md file --- .../algorithms/binary-search-trees/index.md | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/guide/english/algorithms/binary-search-trees/index.md b/guide/english/algorithms/binary-search-trees/index.md index 68fbeed12f..05520d8648 100644 --- a/guide/english/algorithms/binary-search-trees/index.md +++ b/guide/english/algorithms/binary-search-trees/index.md @@ -5,7 +5,7 @@ title: Binary Search Trees ![Binary Search Tree](https://cdn-images-1.medium.com/max/1320/0*x5o1G1UpM1RfLpyx.png) A tree is a data structure composed of nodes that has the following characteristics: -1. Each tree has a root node (at the top) - containing some value (can be any datatype). +1. Each tree has a root node at the top (also known as Parent Node) containing some value (can be any datatype). 2. The root node has zero or more child nodes. 3. Each child node has zero or more child nodes, and so on. This creates a subtree in the tree. Every node has its own subtree made up of its children and their children, etc. This means that every node on its own can be a tree. @@ -332,31 +332,34 @@ void postOrder(struct node* root) { ### Following are common types of Binary Trees: Full Binary Tree/Strict Binary Tree: A Binary Tree is full or strict if every node has exactly 0 or 2 children. - 18 + 18 + / \ / \ 15 30 - / \ / \ - 40 50 100 40 + / \ / \ + 40 50 100 40 In Full Binary Tree, number of leaf nodes is equal to number of internal nodes plus one. Complete Binary Tree: A Binary Tree is complete Binary Tree if all levels are completely filled except possibly the last level and the last level has all keys as left as possible 18 - / \ + / \ + / \ 15 30 - / \ / \ - 40 50 100 40 + / \ / \ + 40 50 100 40 / \ / - 8 7 9 + 8 7 9 Perfect Binary Tree A Binary tree is Perfect Binary Tree in which all internal nodes have two children and all leaves are at the same level. 18 - / \ - 15 30 - / \ / \ - 40 50 100 40 + / \ + / \ + 15 30 + / \ / \ + 40 50 100 40 ### Augumenting a BST Sometimes we need to store some additional information with the traditional data structures to make our tasks easier.