[FEATURE REQUEST] Add Booth's algorithm for lexicographically minimal string rotation
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Start in the repository’s strings package and review existing string algorithms and their test conventions; the payload does not name specific files. Implement an O(n) method returning the smallest rotation’s starting index, with Javadoc and an algorithm reference. Add the requested edge case tests, then verify the “baca” example returns index 3.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I propose adding Booth's algorithm to the strings package to find the starting index of the lexicographically smallest cyclic rotation of a string.
Expected behavior
Return the starting index of the lexicographically smallest rotation.
Achieve O(n) time complexity.
Include tests for empty strings, single characters, repeated characters, periodic strings, and null input.
Include Javadoc and an algorithm reference.
Example
For "baca", the rotations are "baca", "acab", "caba", and "abac". The smallest rotation is "abac", starting at index 3.
This is distinct from checking whether one string is a rotation of another.
- Vorherrschende Sprache
- Java
- Sterne
- 66.4k
- Forks
- 21.3k
- Ø Merge
- 11 Std. 16 Min.
- Gemergte PRs (30 T.)
- 25
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TheAlgorithms/Java
-
[FEATURE REQUEST] Add Search in Rotated Sorted Array implementation with JUnit testsEvtl. wieder frei @Vivek-ML001 hat das vor 57 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
TheAlgorithms/Java#7579 · 7 Kommentare · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
-
[OTHER] Contributors Wanted for New Open-Source ProjectsEvtl. wieder frei @ankkrish hat das vor 49 Tagen übernommen, und es ist kein Pull Request offen. Offenhacktoberfest help wanted stale
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 1/100
TheAlgorithms/Java#7546 · 8 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Centralized Configuration ManagementEvtl. wieder frei @Eyablg-ops hat das vor 36 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
TheAlgorithms/Java#6974 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TheAlgorithms/Java
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ome/ome-codecs#48 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
tonihele/OpenKeeper#672 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Shaded google-api-client trust stores still include AAA Certificate Services (eMudhra CA compromise)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
snowflakedb/snowflake-jdbc#2763 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 79/100
java-native-access/jna#1746 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ControlSystemStudio/phoebus#3983 ·
Maintainer antworten meist innerhalb von 2 Tagen