gitmyhub

java-algorithms-implementation

Java ★ 4.5k updated 3y ago

Algorithms and Data Structures implemented in Java

A readable collection of classic algorithms and data structures in Java, covering sorting, graphs, trees, and more, designed for learning computer science fundamentals and interview prep.

Javasetup: easycomplexity 2/5

java-algorithms-implementation is a collection of classic algorithms and data structures written in Java by Justin Wetherell. The author describes it as material he has implemented over his academic and professional career. The code is written to be correct and readable rather than optimized for maximum performance, and all implementations are tested.

The data structures covered include a wide range of tree types (AVL, B-Tree, Red-Black, Splay, Treap, Patricia Trie, Suffix Tree, and others), along with standard structures like hash maps, queues, stacks, lists, and matrices, plus more specialized ones like KD-Trees, Interval Trees, and Fenwick Trees. Both directed and undirected graph types are included.

Algorithm categories include: sorting, graph algorithms (shortest path via Dijkstra and Bellman-Ford, minimum spanning tree via Prim and Kruskal, cycle detection, topological sort, connected components), search algorithms, string functions, and mathematical operations such as prime testing, greatest common divisor, permutations, modular arithmetic, and the knapsack problem.

This kind of reference collection is useful as a study aid for people learning computer science fundamentals, as a refresher for developers preparing for technical interviews, or as readable source code to consult when you need to understand how a specific algorithm works before adapting it. The README does not describe a library packaging system or build tooling; it is primarily a source code reference organized by category.

The project was created and is maintained by Justin Wetherell.

Where it fits