Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Dijkstra Algorithm Implementation Using PriorityQueue (Fixes #7112)#7123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
prasanth-30011 wants to merge3 commits intoTheAlgorithms:master
base:master
Choose a base branch
Loading
fromprasanth-30011:feature-7112

Conversation

@prasanth-30011
Copy link
Contributor

Summary

This Pull Request adds a clean and efficient implementation of Dijkstra’s Algorithm using a PriorityQueue, as requested in issue#7112.

What This PR Includes

  • New fileDijkstra.java inside the appropriate package.
  • Implementation of Dijkstra’s shortest-path algorithm using:
    • Adjacency list representation
    • Min-heap (PriorityQueue)
  • Detection and handling of negative weighted edges (throws exception, as required).
  • Code follows the structure, style, and formatting used throughout the TheAlgorithms/Java repository.

Why This Change Is Needed

The project did not previously include a fully correct and optimized Dijkstra implementation using a PriorityQueue.
This PR fills that gap and matches the algorithm request posted under issue#7112.

Related Issue

Fixes#7112

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is96.49123% with2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.55%. Comparing base (e6c576c) to head (02f4f23).
⚠️ Report is 4 commits behind head on master.

Files with missing linesPatch %Lines
...com/thealgorithms/greedyalgorithms/KruskalMST.java95.45%1 Missing and 1 partial⚠️
Additional details and impacted files
@@             Coverage Diff              @@##             master    #7123      +/-   ##============================================+ Coverage     78.46%   78.55%   +0.08%- Complexity     6746     6748       +2============================================  Files           758      760       +2       Lines         22339    22431      +92       Branches       4384     4405      +21     ============================================+ Hits          17528    17620      +92+ Misses         4107     4102       -5- Partials        704      709       +5

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DenizAltunkapanDenizAltunkapanAwaiting requested review from DenizAltunkapanDenizAltunkapan is a code owner

@yanglbmeyanglbmeAwaiting requested review from yanglbmeyanglbme is a code owner

@alxkmalxkmAwaiting requested review from alxkmalxkm is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

FEATURE REQUEST] Dijkstra's Algorithm with Priority Queue

2 participants

@prasanth-30011@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp