what is binary tree?

Answer Posted / chinnadurai.s

binary tree is a tree data structure in which each node
has at most two children. Typically the first node is known
as the parent and the child nodes are called left and
right.Binary trees are commonly used to implement binary
search trees and binary heaps.

Types of binary trees are

* A rooted binary tree is a rooted tree in which every
node has at most two children.
* A full binary tree is a tree in which every node
other than the leaves has two children.
* A perfect binary tree is a full binary tree in which
all leaves are at the same depth or same level.This is
ambiguously also called a complete binary tree.
* A complete binary tree is a binary tree in which every
level, except possibly the last, is completely filled, and
all nodes are as far left as possible.
* An infinite complete binary tree is a tree with
levels, where for each level d the number of existing nodes
at level d is equal to 2d. T
* A balanced binary tree is where the depth of all the
leaves differs by at most 1. Balanced trees have a
predictable depth. This depth is equal to the integer part
of log2(n) where n is the number of nodes on the balanced tree.
Example 1: balanced tree with 1 node, log2(1) = 0 (depth = 0).
Example 2: balanced tree with 3 nodes, log2(3) = 1.59
(depth=1). Example 3: balanced tree with 5 nodes, log2(5) =
2.32 (depth of tree is 2 nodes).

* A rooted complete binary tree can be identified with a
free magma.
* A degenerate tree is a tree where for each parent
node, there is only one associated child node. This means
that in a performance measurement, the tree will behave like
a linked list data structure.

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by stable sort?

521


Explain the Linked List

634


What is priority queue in data structure?

478


What is bubble sort with example?

495


Which sorting method is slowest?

529






What are the two traversal strategies used in traversing a graph?

551


How do you separate zeros from non-zeros in an array?

522


What do you mean by back edge?

618


Can you provide some implementation of a dictionary having large number of words?

707


What are the major data structures used in the network data model?

650


What are some of the best practices relating to the java collection framework?

508


How would you use bsearch() function to search a name stored in array of pointers to string?

484


What is mergesort and hashtable?

639


Mention the steps to insert data at the starting of a singly linked list?

570


What is the use of bubble sort?

520