This repository contains the implementation of several commonly used data structures and sorting algorithms in computer science. The implemented algorithms include:
Binary search trees (BSTs) are a data structure that maintain an ordered collection of elements. BSTs are organized in such a way that each node has a parent and two children, with the property that all nodes in the left subtree have smaller values than the parent, and all nodes in the right subtree have larger values.
Heapsort is a comparison-based sorting algorithm that works by transforming the input array into a max heap, and then repeatedly extracting the maximum element and re-heapifying the remaining elements. Heapsort has a worst-case time complexity of O(n log n).
Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort. Insertion sort has a worst-case time complexity of O(n^2).
Mergesort is a divide-and-conquer sorting algorithm that works by dividing the input array into two halves, recursively sorting each half, and then merging the two sorted halves together. Mergesort has a worst-case time complexity of O(n log n).
Quicksort is a divide-and-conquer sorting algorithm that works by selecting a pivot element from the array and partitioning the other