-
Notifications
You must be signed in to change notification settings - Fork 181
Kruskal algorithm #237
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Kruskal algorithm #237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you follow the directory structure Graphs/[Algorithm Name]/[Language]/[FileName]. Also make some minor changes to your code. Everything else seems fine.
This implementation is using DSU. O = M*log(N); | ||
M - edges, N - nodes. | ||
*/ | ||
//FUNCTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this comment
We know that you are listing functions.
So you can remove //Functions.
return graph; | ||
} | ||
|
||
void find_mst(int n, std::vector<std::pair<int, std::pair<int, int> > > graph) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return the value that you want to be printed.
Don't make this function find as well as print the values.
dsu_unite(a, b); | ||
} | ||
} | ||
print_result(weight, &mst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take this function call and place it in main()
@GnikDroy thanks for your reply, il'l work on it |
are you still working on it? |
Yep, give me some time.
пн, 8 окт. 2018 г. в 11:24, T Thiyagaraj <[email protected]>:
… are you still working on it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#237 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoXQHR3eYQnYtMusJEhzzwLnT8_ScuVbks5uiwu6gaJpZM4XJ5S7>
.
|
Description
Implementation of Kruskal algorithm with DSU in O(MlogN);
Related Issue
Please link to the issue here:
#236
How Has This Been Tested? (Optional)
Default test in main();
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Bug fix (change which fixes an issue with the algorithm)
[x ] New Algorithm (non-breaking change which adds functionality)
Documentation
Checklist:
Go over all the following points, and put an
x
in all the boxes that apply.If you're unsure about any of these, don't hesitate to ask. We're here to help!
[x ] My code follows the code style of this project.
My change requires a change to the documentation.
I have updated the documentation accordingly.
[ x] I have read the CONTRIBUTING document.