Binary tree and binarytree parts, Data Structure & Algorithms

Q. What do you understand by the term Binary Tree? What is the maximum number of nodes which are possible in a Binary Tree of depth d. Explain the terms given below with respect to the Binary trees
1)Strictly Binary Tree       
2) Complete Binary Tree
3) Almost Complete Binary Tree                                                               

Ans:

A binary tree is a tree in which no nodes can posses' more than two children.

Figure drawn below shows us that the binary tree consists of the root and two subtrees, Tl and Tr, both of which could possibly be empty.

1962_Binary Tree.png

 

The highest numbers of nodes a binary tree of depth d can have is 2 d+1-1.

(i)      Strictly Binary Tree:- If every non leaf node in binary tree has neither the left tree nor the right tree empty subtrees , then the tree is known as a strictly binary tree.

(ii)     Complete Binary Tree:- The complete binary tree of depth d is that strictly binary tree whose all the leaves are at level D.

(iii)     Almost  Complete  Binary  Tree:- The  binary tree  of  depth  d  is  an  almost complete binary tree if and only if:
1.Any node end at level less than d-1 has two children.
2. for any node nd in the tree with

(iv)    a right descendant at the level d, nd should have a left child and every descendant of the nd is either a leaf at level d or has two children.

Posted Date: 7/10/2012 7:25:48 AM | Location : United States







Related Discussions:- Binary tree and binarytree parts, Assignment Help, Ask Question on Binary tree and binarytree parts, Get Answer, Expert's Help, Binary tree and binarytree parts Discussions

Write discussion on Binary tree and binarytree parts
Your posts are moderated
Related Questions
Algorithm to Delete a given node from a doubly linked list Delete a Node from Double Linked List DELETEDBL(INFO, FORW, BACK, START, AVAIL,LOC) 1. [Delete Node] Set FOR

Double Linked List In a doubly linked list, also known as 2 way lists, each node is separated into 3 parts. The first part is called last pointer field. It has the address of t

what is an algorithms

important points on asymptotic notation to remember

Program: Program segment for insertion of an element into the queue add(int value) { struct queue *new; new = (struct queue*)malloc(sizeof(queue)); new->value = val

write a program that find,search&replace a text string

What are stacks? A stack is a data structure that organizes data similar to how one organizes a pile of coins. The new coin is always placed on the top and the oldest is on the

Prove that uniform cost search and breadth- first search with constant steps are optimal when used with the Graph-Search algorithm (see Figure). Show a state space with varying ste

There are four data type groups:  Integer kepts whole numbers and signed numbers Floating-point Stores real numbers (fractional values). Perfect for storing bank deposit

QUESTION (a) Construct a binary tree for the following numbers assuming that a number greater than the node (starting from the root) goes to the left else it goes to the right.