Skip to content

Refactor SuffixArraySlow/Med, expand test coverage#1272

Merged
williamfiset merged 1 commit into
masterfrom
refactor-suffixarray-slow
Mar 10, 2026
Merged

Refactor SuffixArraySlow/Med, expand test coverage#1272
williamfiset merged 1 commit into
masterfrom
refactor-suffixarray-slow

Conversation

@williamfiset

Copy link
Copy Markdown
Owner

Summary

  • Refactor SuffixArraySlow: fix package order, add file-level header with Big-O, replace FQN java.util.Arrays with import, rename min_len to minLen, make suffixes private, add Javadoc to construct()
  • Refactor SuffixArrayMed: fix package order, add file-level header with prefix doubling algorithm explanation, replace FQN with import, make SuffixRankTuple private, add Javadoc, remove large block of commented-out code in main(), remove useless null assignments, improve inline comments
  • Fix Big-O notation in both files to use explicit brackets: O(n*log(n)) instead of O(n log n)
  • Expand test coverage (6 → 13 tests): null input, single/two char edge cases, int[] constructor, getTextLength(), sorted suffix verification, randomized cross-validation (200 random strings across all 3 implementations)
  • Clean up test file: remove unused fields, empty @BeforeEach, wildcard import

Test plan

  • All 13 suffix array tests pass across SuffixArraySlow, SuffixArrayMed, and SuffixArrayFast

🤖 Generated with Claude Code

Refactor SuffixArrayMed: fix package order, add file-level docs with
algorithm explanation, replace FQN with import, make SuffixRankTuple
private, add Javadoc, remove commented-out code and useless null
assignments, improve inline comments.

Fix Big-O notation to use explicit brackets: O(n*log(n)) not O(n log n).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@williamfiset williamfiset force-pushed the refactor-suffixarray-slow branch from f160734 to f70269d Compare March 10, 2026 04:17
@williamfiset williamfiset merged commit 973a3e7 into master Mar 10, 2026
2 checks passed
@williamfiset williamfiset deleted the refactor-suffixarray-slow branch March 10, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant