Title: added changes to your bellmanford.js by Ujwal200707 · Pull Request #1861 · TheAlgorithms/JavaScript · GitHub
Open Graph Title: added changes to your bellmanford.js by Ujwal200707 · Pull Request #1861 · TheAlgorithms/JavaScript
X Title: added changes to your bellmanford.js by Ujwal200707 · Pull Request #1861 · TheAlgorithms/JavaScript
Description: The change replaces the final loop with a direct return statement. Previously, the code looped through all vertices to find the destination and then returned its distance. This loop was unnecessary because the destination index is already known. By using: return dis[dest] the code becomes more efficient and readable. It removes redundant iterations, reduces time complexity for that part from O(V) to O(1), and makes the function cleaner without affecting the output.
Open Graph Description: The change replaces the final loop with a direct return statement. Previously, the code looped through all vertices to find the destination and then returned its distance. This loop was unnecessary...
X Description: The change replaces the final loop with a direct return statement. Previously, the code looped through all vertices to find the destination and then returned its distance. This loop was unnecessary...
Opengraph URL: https://github.com/TheAlgorithms/JavaScript/pull/1861
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4576b78d-ca2c-126c-cd8a-9f96f1f1d99d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B462:192D74:1662E5:1DAEBD:696AFEDD |
| html-safe-nonce | c0e8a4445b79a57e10c04a9bdfa12460e63796f218d59f4580b01c7449ea6000 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDYyOjE5MkQ3NDoxNjYyRTU6MURBRUJEOjY5NkFGRUREIiwidmlzaXRvcl9pZCI6IjkxNjA0Nzg2ODkzMTkzODY4NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 630217054cb1b2bad43f6dfbd257eca6f27620321f3b9606bba9eaf87e54251f |
| hovercard-subject-tag | pull_request:3046096612 |
| 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/TheAlgorithms/JavaScript/pull/1861/files |
| twitter:image | https://avatars.githubusercontent.com/u/203006835?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/203006835?s=400&v=4 |
| og:image:alt | The change replaces the final loop with a direct return statement. Previously, the code looped through all vertices to find the destination and then returned its distance. This loop was unnecessary... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 97086543 |
| octolytics-dimension-repository_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width