Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[FEATURE REQUEST] Add Booth's algorithm for lexicographically minimal string rotation

未關閉
#7,643 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@vedant0517 已經在處理了。

開始於 2026年10月11日。

  • #7644 來自 @vedant0517 —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
25/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java
領域
backend

研究方向

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

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TheAlgorithms/Java 的其他 Issue

查看 TheAlgorithms/Java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。