Skip to main content

Data structures: Introduction to Trees

Tree:The data in a tree are not stored in a sequential manner i.e., they are not stored linearly. Instead, they are arranged on multiple levels or we can say it is a hierarchical structure. For this reason, the tree is considered to be a non-linear data structure.
KeyConcepts:
Nodes: Individual units within the tree, each storing data and potentially linking to other nodes.
Edges: Connections between nodes, representing relationships (parent-child, sibling, etc.).
Root: The topmost node in the tree, from which all other nodes originate.
Parent: A node that has one or more child nodes.
Child: A node connected to a parent node.
Leaf: A node with no children.
Subtree: A portion of a tree that is itself a tree.
Representation of tree:
Binary search tree:

Comments

Popular posts from this blog

Hashing and hash functions

Types of hash functions

Data structures dequeues