Skip to main content

Posts

Showing posts with the label The Crazy Programmer Difference between Binary Tree and Binary Search Tree Difference between Binary Tree and Binary Search Tree The Crazy Programmer

Difference between Binary Tree and Binary Search Tree Vijay Sinha The Crazy Programmer

In this article, we will look at the difference between Binary Tree and Binary Search Tree. These topics are very important because these act as an underlying data structure for various other data structures. So, we will look at the description of each with examples and compare their properties. Binary Tree A Binary tree is a type of Tree data structure, Non-Linear (data is not contiguous or in sequence) in nature. It represents data in a hierarchical format. A binary tree like a regular tree comprises of nodes that are not Ordered . Each node in a binary tree can have a maximum of 2 child nodes . It can have 0,1 or 2 nodes. A node is represented as a parent or child node. A Parent node can have at most two children- Left Child and Right Child . The node which has at least two children is called Internal Node . Hence, each node in memory contains the following attributes: Data (Can be of any type). Left Pointer which has the reference for Left Child. Right Pointer which has the