This repository contains implementations of various data structures and algorithms in Java. The implementations cover basic, intermediate, and advanced topics to help you understand and utilize these concepts in your projects.
An implementation of a resizable array, similar to the built-in ArrayList
in Java.
A doubly linked list implementation, providing efficient insertion and deletion operations.
A first-in, first-out (FIFO) data structure implementation.
A last-in, first-out (LIFO) data structure implementation.
A tree data structure in which each node has at most two children, with the left child having a smaller value and the right child having a larger value.
A tree data structure where each node has at most two children.
A complete binary tree which satisfies the heap property, useful for priority queue implementations.
An advanced queue that allows for the retrieval of elements according to their priority.
A thread-safe queue that supports operations that wait for the queue to become non-empty when retrieving an element and wait for space to become available in the queue when storing an element.
A queue that supports insertion and removal of elements from both ends.
A data structure that implements a map interface using hashing for efficient key-value pair storage.
A data structure that keeps track of a partition of a set into disjoint (non-overlapping) subsets, useful for Kruskal's algorithm and network connectivity.
A balanced binary search tree with additional properties to ensure the tree remains balanced during insertions and deletions.
A self-balancing binary search tree where the difference between heights of left and right subtrees cannot be more than one for all nodes.
A self-balancing tree data structure that maintains sorted data and allows for efficient insertion, deletion, and search operations.
A data structure consisting of nodes (vertices) and edges connecting pairs of nodes, useful for representing networks and relationships.
An algorithm for traversing or searching tree or graph data structures, starting from the root and exploring as far as possible along each branch before backtracking.
An algorithm for traversing or searching tree or graph data structures, starting from the root and exploring all neighbor nodes at the present depth level before moving on to nodes at the next depth level.
An algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks.
An algorithm for finding the minimum spanning tree of a graph, which finds a subset of the edges that connects all vertices together without any cycles and with the minimum possible total edge weight.
Contributions are welcome! Please open an issue or submit a pull request with your improvements.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.