Hierarchical clustering is a versatile technique used to organize data into a hierarchical structure of nested clusters, revealing insights into the inherent structure and relationships within the dataset. Unlike partitional clustering methods that require a predetermined number of clusters, hierarchical clustering does not impose such constraints, allowing for a more flexible and adaptive approach to clustering analysis. The algorithm iteratively groups data points into clusters based on their similarity or dissimilarity, resulting in a hierarchical tree-like structure known as a dendrogram. At each step of the clustering process, the algorithm identifies the most similar or dissimilar pairs of clusters or data points and merges or divides them forming larger or smaller clusters until a predefined stopping criterion is met.