Repository navigation
knapsack: explain computational cost and operation bounds (R58-T005) - #83
Open
utkarsh21022009-boop wants to merge 1 commit into
Open
utkarsh21022009-boop wants to merge 1 commit into
utkarsh21022009-boop wants to merge 1 commit into
Conversation
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.
Pull Request
Pull Request
R58-T005: knapsack: computational cost analysis and domain benchmarking
Description
Analyzed and explained the computational cost of the reference implementation in$N$ ) and capacity bound ($W$ ), evaluated three valid domain input sizes from the canonical test suite, counted operations and branches across all cases, executed empirical micro-benchmarking reporting medians over 7 repetitions under constant conditions after asserting correctness, and distinguished pure algorithm work from process startup and compilation overhead.
exercises/practice/knapsack/.meta/src/reference/java/Knapsack.javafor Task R58-T005. Defined input size in terms of item records (Related Issue
Fixes: #5
Type of Change
Changes Made
exercises/practice/knapsack/.meta/src/reference/java/Knapsack.java:int maximumValue(int maximumWeight, List<Item> items).docs/maintenance/knapsack.md:example knapsack, 55 cells, 209 ns), Medium (8 items, 945 cells, 1,209 ns), and Large (15 items, 12,016 cells, 13,250 ns).work/R58-T005/original/Knapsack.java: Preserved pristine snapshot of original reference for baseline comparison.work/R58-T005/check.py: Implemented automated verification script using Python subprocess and isolated temporary directories to run./gradlew testand in-process timing.tools/course_checks/r58-t005.py: Added course check runner entry point.work/R58-T005/results.jsonandlatest-result.json: Recorded verification results, exact operation counts, and tool versions.work/R58-T005/README.md: Documented task purpose, structure, and execution instructions.Screenshots / Recordings
Not applicable — no UI changes.
Testing
python3 work/R58-T005/check.pyandpython3 tools/course_checks/r58-t005.py../gradlew testin an isolated scratch directory with all tests enabled:./gradlew check::practice:knapsack:checkstyleMainPASSED:practice:knapsack:checkstyleTestPASSED:practice:knapsack:testPASSEDexercises/practice/knapsack/src/main/java/Knapsack.javaverified to remain unsolved (UnsupportedOperationException) and unmodified.Checklist
Additional Notes
student/e26b07f0710/R58-T005(andR58-T005/student/e26b07f0710-R58-T005).S-AI-Projects/exercism-javaonmain.Reviewer Resources:
Track Policies
Reviewer Resources:
Track Policies