Wednesday, 2 May 2018

1. Introduction to Trees

1. What is Tree?
1.     In computer science, a tree is a widely used ADT (Abstract Data Type) or data structure implementing this ADT.
2.     Arrays, Linked Lists, Stacks, Queues are linear data structures, but Trees are hierarchal data structures.



2. What is Binary Tree?
1.     In Tree data structure contains any number of child nodes to parent node.
2.     In Binary Tree data structure in which a record is linked to two successor records, usually referred to as the left node and right node.




3. What is Binary Search Tree?
1.     A Binary Search Tree (BST) is a sorted binary tree.
2.     In which a record is linked to two successor records, usually referred to as the left branch when greater and the right when less than the previous record.
3.     Means left node is smaller than parent and right node is greater than parent node.




4. Vocabulary of a Tree.
1.     Root: The topmost node is called root of the tree.
2.     Children: The elements that are directly under an element are called its children.
3.     Parent: The element directly above something is called its parent.
4.     Leaves: elements with no children are called leaves.



No comments:

Post a Comment

3. Java Program to create Binary Tree