[FEATURE REQUEST] Add Booth's algorithm for lexicographically minimal string rotation
维护者通常 1 天内回复
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 66.4k
- 派生
- 21.3k
- 平均合并
- 11 小时 16 分钟
- 30 天内合并 PR
- 25
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TheAlgorithms/Java 的其他 Issue
-
[FEATURE REQUEST] Add Search in Rotated Sorted Array implementation with JUnit tests可能重新可做 @Vivek-ML001 于 59 天前认领,目前没有进行中的 PR。 未关闭enhancement
TheAlgorithms/Java#7579 · 7 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
-
[OTHER] Contributors Wanted for New Open-Source Projects可能重新可做 @ankkrish 于 51 天前认领,目前没有进行中的 PR。 未关闭hacktoberfest help wanted
难度 5/5 一周以上 新手友好度 1/100
TheAlgorithms/Java#7546 · 10 条评论 ·
维护者通常 1 天内回复
-
Centralized Configuration Management可能重新可做 @Eyablg-ops 于 38 天前认领,目前没有进行中的 PR。 未关闭enhancement
难度 5/5 一周以上 新手友好度 20/100
TheAlgorithms/Java#6974 · 3 条评论 ·
维护者通常 1 天内回复
查看 TheAlgorithms/Java 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
521xueweihan/HelloGitHub#4105 ·
-
Awaiting further input from submitter
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
-
Regression in 5.9.0: CuratorCache fails with ClassCastException when the client is not a CuratorFrameworkBase可能已有人在做 @sftwnd 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复