Skip to content

Added the implementation of prims algorithm in cpp#221

Closed
harshendram wants to merge 8 commits intoPradeepsingh61:mainfrom
harshendram:Algo/prims
Closed

Added the implementation of prims algorithm in cpp#221
harshendram wants to merge 8 commits intoPradeepsingh61:mainfrom
harshendram:Algo/prims

Conversation

@harshendram
Copy link
Copy Markdown
Contributor

This pull request introduces a new implementation of Prim's algorithm in C++ for finding the Minimum Spanning Tree (MST) of a weighted undirected graph. The code includes both the algorithm logic and a sample usage in the main function.

issue no #220

Algorithm implementation:

  • Added a complete function primMST that uses a priority queue to efficiently select the next edge with the minimum weight, along with supporting data structures for keys, parents, and MST membership.

Sample usage and demonstration:

  • Provided a main function that sets up a sample graph with 5 vertices, adds edges with weights, and calls primMST to display the MST edges and total weight.

Dear Maintainers
@Pradeepsingh61 please add the required labels such as hacktoberfest-accepted and hacktoberfest2025 and merge the PR

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Failed

📋 Next Steps

⚠️ Action needed: Please fix the compilation errors and push your changes.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Failed - Please fix compilation errors and try again.

📋 Overall Status

⚠️ Needs Work - Please address the issues above.
💡 Push new commits to automatically re-run these checks.


This comment was generated automatically. Checks will re-run when you push new commits.

@Karanjot786
Copy link
Copy Markdown
Collaborator

Karanjot786 commented Oct 1, 2025

Fix this error Changed files: CPP/algorithms/greedy_algorithms/prim's_algorithm.cpp /home/runner/work/_temp/bf3f9666-2fc9-4566-9f85-77210b566b2a.sh: line 27: syntax error near unexpected token `if' Error: Process completed with exit code 2.

line 27: syntax error near unexpected token `if'

@harshendram
Copy link
Copy Markdown
Contributor Author

ok I will fix it now

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Failed

📋 Next Steps

⚠️ Action needed: Please fix the compilation errors and push your changes.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Failed - Please fix compilation errors and try again.

📋 Overall Status

⚠️ Needs Work - Please address the issues above.
💡 Push new commits to automatically re-run these checks.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions github-actions Bot requested a review from Karanjot786 October 1, 2025 14:13
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @harshendram! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@Karanjot786
Copy link
Copy Markdown
Collaborator

@harshendram can you explain me why you change the CI workflows files

@harshendram
Copy link
Copy Markdown
Contributor Author

harshendram commented Oct 1, 2025

hey @Karanjot786 your ci cd doesn't work for files with names of * or apostrophe ' since i named the file as prim's algorithm
i tried to implement the ci cd but then i reverted back and made it normal what your main repo consists

so now dw your ci cd files are exactly same as what it was

apologies for my mistake

@Pradeepsingh61
Copy link
Copy Markdown
Owner

@harshendram now it is already fixed now can you remove it or i will close this PR and you open new one i will merge it now and it's ok

@Pradeepsingh61
Copy link
Copy Markdown
Owner

Pradeepsingh61 commented Oct 1, 2025

now i am closing this PR and you can open new PR

@harshendram
Copy link
Copy Markdown
Contributor Author

@Pradeepsingh61 okay thanks for your reply i have created a new pr

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants