In: Computer Science
Define a tree. Distinguish between a tree and a binary tree.
Distinguish between a binary tree and a binary search tree.
Tree is a hierarchical data structure which stores the information naturally in the form of hierarchy style. Tree is one of the most powerful and advanced data structures. It is a non-linear data structure compared to arrays, linked lists, stack and queue. It represents the nodes connected by edges.
The main difference between tree and binary tree is that tree arranges data in a structure similar to a tree, in a hierarchical manner, while a binary tree is a type of tree in which a parent node can have a maximum of two child nodes.
A binary tree is a type of data structure where each parent node can have at most two child nodes. The binary search tree is a binary tree where the left child contains only nodes with values less than or equal to the parent node, and where the right child only contains nodes with values greater than the parent node