Title: perf(linked-list): measure scaling and link integrity of AddTwoNumbers (R50-T049) by aniruddha-bongale · Pull Request #97 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: perf(linked-list): measure scaling and link integrity of AddTwoNumbers (R50-T049) by aniruddha-bongale · Pull Request #97 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: perf(linked-list): measure scaling and link integrity of AddTwoNumbers (R50-T049) by aniruddha-bongale · Pull Request #97 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description Measure the scaling behavior of AddTwoNumbers in Data-Structures/Linked-List/AddTwoNumbers.js while validating algorithm correctness. Add comprehensive complexity documentation naming the input size variable $L = \max(M, N)$, distinguishing theoretical worst-case claims from empirical observations, add regression tests with separate node link and value assertions on three distinct nodes $A \to B \to C$ and smallest supported lists, and implement an automated benchmark and test runner in work/R50-T049/check.py saving metrics to work/R50-T049/results.json. Related Issue Fixes: #49 Type of Change Documentation update Tests (adding missing tests or fixing existing tests) Changes Made Added detailed complexity analysis in Data-Structures/Linked-List/AddTwoNumbers.js documenting the input size variable $L = \max(M, N)$, theoretical worst-case time complexity $O(\max(M, N))$, and empirical observation across $L \in {100, 1000, 10000}$ nodes showing strictly linear scaling. Exported Node alongside AddTwoNumbers from Data-Structures/Linked-List/AddTwoNumbers.js. Added unit tests in Data-Structures/Linked-List/test/AddTwoNumbers.test.js: Distinct nodes $A \to B \to C$ ($[2, 4, 3]$) and smallest supported single node ($[5]$) with separate link checks (pointer integrity) and value checks ($[7, 4, 3]$). Two smallest supported single-node lists with carry ($[5] + [5] = [0, 1]$) with separate link and value checks. Multi-node carry propagation ($[9, 9, 9] + [1] = [0, 0, 0, 1]$). Implemented work/R50-T049/check.py to run native tests, verify link and value assertions, execute 5 repetitions per size with fixed deterministic pseudo-random seeds, measure median and range execution times isolated from process and I/O overhead, and record results in work/R50-T049/results.json. Screenshots / Recordings All 4 unit tests for AddTwoNumbers passed cleanly. All 5 repetitions across sizes $L \in {100, 1000, 10000}$ passed correctness checks. Testing Ran npm test -- Data-Structures/Linked-List/test/AddTwoNumbers.test.js - all 4 tests passed. Executed python3 work/R50-T049/check.py - scaling and fixture assertions verified. Validated Prettier formatting across all touched files. Checklist My code follows the style guidelines of this project I have performed a self-review of my code I have commented my code, particularly in hard-to-understand areas I have added tests that prove my fix is effective or that my feature works New and existing unit tests pass locally with my changes Additional Notes Student: Aniruddha Bongale (Enrollment: E26B07F0827) Task ID: R50-T049
Open Graph Description: Description Measure the scaling behavior of AddTwoNumbers in Data-Structures/Linked-List/AddTwoNumbers.js while validating algorithm correctness. Add comprehensive complexity documentation naming t...
X Description: Description Measure the scaling behavior of AddTwoNumbers in Data-Structures/Linked-List/AddTwoNumbers.js while validating algorithm correctness. Add comprehensive complexity documentation naming t...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/97
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f4fb7c48-eeb5-4691-0d4b-6535adfef143 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B0BA:1CD523:2EC3577:3EC6834:6B06DAC6 |
| html-safe-nonce | cfa5bdffde700ab75dc2640316294921226dc7d7550843162f58b489eecf4920 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEJBOjFDRDUyMzoyRUMzNTc3OjNFQzY4MzQ6NkIwNkRBQzYiLCJ2aXNpdG9yX2lkIjoiNTU5MDM5MTcyNzQ1NTUwNTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b56e50328b765d6f51b7ecc72612a7e23d6e37b08a7436ed18e3b279fa3a2dc5 |
| hovercard-subject-tag | pull_request:5437016006 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/97/files |
| twitter:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| og:image:alt | Description Measure the scaling behavior of AddTwoNumbers in Data-Structures/Linked-List/AddTwoNumbers.js while validating algorithm correctness. Add comprehensive complexity documentation naming t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06cadd0061c549662a50be90eb5baba7608f00f521574931eec01db0deb9e636 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/S-AI-Projects/TheAlgorithms-JavaScript git https://github.com/S-AI-Projects/TheAlgorithms-JavaScript.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444142713 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 97086543 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6953c712585a8d7406b7695e48fffcb670fd241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width