Repository navigation
docs(strings): document worst-case O(n) complexity and add scaling be… - #49
Open
Sapna2007-sst wants to merge 1 commit into
Open
Sapna2007-sst wants to merge 1 commit into
Sapna2007-sst wants to merge 1 commit into
Conversation
…nchmarks for KasaiAlgorithm (R45-T009)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clang-format -i --style=file path/to/your/file.javaDescription
This pull request resolves task R45-T009 / Issue #9 by analyzing and measuring the algorithmic scaling of$O(n)$ time (the prefix length counter $k$ is bounded by $n$ and decremented at most $n$ times total, limiting total character increment operations $k++$ across all inner while loops to at most $2n$ ). It adds smallest valid input fixture tests, ordinary fixtures, an independent prefix oracle regression, and an isolated CPU-only benchmark in $n = 1,000, 5,000, 25,000$ ) over 5 repetitions with correctness verified outside the timed interval.
KasaiAlgorithm.java. It provides an expanded theoretical complexity statement establishing why Kasai's algorithm strictly runs inwork/R45-T009/across three input sizes (Related Issue
Closes #9
Related to: #9
Type of Change
Changes Made
Javadoc Documentation (
KasaiAlgorithm.java):invSuffandlcp.Unit & Regression Tests (
KasaiAlgorithmTest.java):testSmallestValidInputFixtureEmptyPrecondition: Verifies smallest valid empty input ("",[]), asserting returned array is[](branched at line 55).testSmallestValidInputFixtureSingleCharPrecondition: Verifies single-character input ("A",[0]), asserting returned array is[0](line 51, line 75).testDocumentedOrdinaryAbracadabraFixture: Verifies ordinary input"abracadabra"with suffix array[10, 7, 0, 3, 5, 8, 1, 4, 6, 9, 2], asserting exact expected LCP[1, 4, 1, 1, 0, 3, 0, 0, 0, 2, 0].testKasaiRepresentativeScalingFixture: Verifies deterministic pseudo-random input (testPrivateConstructorContract: Reflection contract test verifying private constructor encapsulation.Isolated Benchmark & Verification Harness (
work/R45-T009/):Benchmark.java: Measures execution ofKasaiAlgorithm.kasaiin isolation acrosscheck.py: Runsmvn test -Dtest=KasaiAlgorithmTest,mvn checkstyle:check, andBenchmark.java. Generatesresults.jsonandevidence.md. All checks pass with 0 failures and 0 checkstyle violations.Screenshots / Recordings