mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
2da0465fe08d634093c89e4f29bf67be00082d50
* feat(geometry): add Bentley-Ottmann line segment intersection algorithm - Implement sweep-line algorithm for finding all intersection points - Time complexity: O((n + k) log n) where n is segments, k is intersections - Uses event queue (PriorityQueue) and status structure (TreeSet) - Handles vertical/horizontal segments, collinear overlaps, and touching endpoints - Includes comprehensive Javadoc with examples and references * test(geometry): add comprehensive tests for Bentley-Ottmann algorithm - 19 test cases covering typical, edge, and degenerate cases - Tests include: single/multiple intersections, parallel segments, grid patterns - Performance test with 100 random segments - All tests validate correctness of intersection detection * style(geometry): fix code style * test(geometry): Achieve 100% test coverage for BentleyOttmann * style(geometry): fix code style again * fix: correct import order in BentleyOttmann * fix(geometry): Resolve SpotBugs and PMD static analysis warnings * Reorder import statements in BentleyOttmannTest --------- Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
The Algorithms - Java
You can run and edit the algorithms, or contribute to them using Gitpod.io (a free online development environment) with a single click.
All algorithms are implemented in Java (for educational purposes)
These implementations are intended for learning purposes. As such, they may be less efficient than the Java standard library.
Contribution Guidelines
Please read our Contribution Guidelines before you contribute to this project.
Algorithms
Our directory has the full list of applications.
Description
All Algorithms implemented in Java
algorithmalgorithm-challengesalgorithmsalgorithms-datastructuresdata-structureshacktoberfestjavasearchsortsorting-algorithms
Readme
MIT
174 MiB
Languages
Java
100%