Skip to content

Prism Algorithm#372

Merged
Pradeepsingh61 merged 3 commits into
Pradeepsingh61:mainfrom
JitinSaxenaa:prism
Oct 3, 2025
Merged

Prism Algorithm#372
Pradeepsingh61 merged 3 commits into
Pradeepsingh61:mainfrom
JitinSaxenaa:prism

Conversation

@JitinSaxenaa

Copy link
Copy Markdown
Contributor

📋 Pull Request Description

What does this PR add?

  • New algorithm implementation
  • Data structure implementation
  • New programming language support
  • Language-specific README
  • Bug fix
  • Documentation improvement
  • Test cases

Algorithm/Feature Details

  • Name: Prim’s Algorithm
  • Language: C++
  • Category: Graph / Greedy
  • Time Complexity: O(V²) – using adjacency matrix
  • Space Complexity: O(V²) – adjacency matrix storage

Description:
Prim’s Algorithm finds the Minimum Spanning Tree (MST) of a weighted, undirected graph. It starts from an arbitrary vertex and grows the MST by repeatedly adding the smallest edge connecting a vertex in the MST to a vertex outside of it. The implementation uses an adjacency matrix for simplicity.

Testing

  • Code compiles without errors
  • All test cases pass
  • Edge cases handled (e.g., disconnected vertices handled as 0-weight/no-edge)
  • Documentation updated

Example Test Case:
Input:

4
0 1 3 0
1 0 3 4
3 3 0 2
0 4 2 0

Output:

Edges in the Minimum Spanning Tree (MST):
Edge    Weight
0 - 1   1
2 - 0   3
3 - 2   2

Screenshots (if applicable)

N/A for CLI-based algorithm.

Additional Notes

  • The implementation can be optimized using a priority queue (min-heap) to achieve O(E log V) time complexity for larger graphs.
  • Current implementation is beginner-friendly and easy to understand using adjacency matrix.

@github-actions

github-actions Bot commented Oct 3, 2025

Copy link
Copy Markdown

🎉 Welcome to Hacktoberfest 2025, @JitinSaxenaa! 🎃

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 commented Oct 3, 2025

Copy link
Copy Markdown

🤖 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 github-actions Bot requested a review from Karanjot786 October 3, 2025 13:57
@Pradeepsingh61 Pradeepsingh61 merged commit ba81598 into Pradeepsingh61:main Oct 3, 2025
18 checks passed
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.

2 participants