Binary trees, Data Structure & Algorithms

Assignment Help:

A binary tree is a special tree where each non-leaf node can have atmost two child nodes. Most important types of trees which are used to model yes/no, on/off, higher/lower, i.e., binary decisions are binary trees.

Recursive Definition: A binary tree is either empty or a node that has left and right sub-trees that are binary trees. Empty trees are represented as boxes (but we will almost always omit the boxes).

In a formal way, we can described binary tree as a finite set of nodes which is either empty or partitioned in to sets of T0, Tl, Tr , where T0 is the root and Tl and Tr are left and right binary trees, respectively.

Properties of a binary tree are following

  • If a binary tree contains n nodes, then it have exactly n - 1 edges;
  • A Binary tree of height h contains 2h - 1nodes or less.
  • If we have a binary tree having n nodes, then the height of the tree is at most n and at least ceiling log2(n + 1).
  • If a binary tree contain n nodes at a level l then, it has at most 2n nodes at a level l+1
  • The total number of nodes in binary tree with depth d (root has depth zero) is

                       N = 20 + 21 + 22 + .......+ 2d = 2d+1 - 1


Related Discussions:- Binary trees

Explain the concept of hidden lines and surface removal, Explain the concep...

Explain the concept of hidden lines The problem of hidden lines or surfaces was implicit even in 2-D graphics, but we did not mention it there, because what was intended to be

Explain insertion sort, Q. Explain the insertion sort with a proper algorit...

Q. Explain the insertion sort with a proper algorithm. What is the complication of insertion sort in the worst case?

Define order of growth, Define order of growth The  efficiency  analysi...

Define order of growth The  efficiency  analysis  framework  concentrates   on  the  order  of  growth  of  an  algorithm's   basic operation count as the principal indicator o

Link list, algorithm for multiplication of two sparse matrices using link l...

algorithm for multiplication of two sparse matrices using link list

Algorithm, implement multiple stacks in a single dimensional array. write a...

implement multiple stacks in a single dimensional array. write algorithm for various stack operation for them

Define strictly binary tree, Define Strictly Binary Tree Strictly Bina...

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t

File organization, Define File organization''s and it''s types

Define File organization''s and it''s types

Shortest path algorithms, A driver takes shortest possible route to attain ...

A driver takes shortest possible route to attain destination. The problem which we will discuss here is similar to this type of finding shortest route in any specific graph. The gr

Explain merge sort, Question 1 Explain the use of algorithms in computing ...

Question 1 Explain the use of algorithms in computing Question 2 Explain time complexity and space complexity of an algorithm Question 3 Explain how you can analyz

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd