-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
fix: main function bugs #2709
fix: main function bugs #2709
Conversation
4, 8, INFINITY, 0, 5, 7, | ||
INFINITY, 3, 1, 5, 0, INFINITY, | ||
INFINITY, INFINITY, INFINITY, 7, INFINITY, 0}; | ||
constexpr int POSITIVE_INFINITY = 99999; |
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.
why not use numeric_limits<int>::infinty();
from the cmath library?
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.
numeric_limits::infinty() returns 0
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.
Ah I forgot infinity only works for floats. What about numeric_limit::max()?
constexpr int POSITIVE_INFINITY = 99999; | ||
std::array<std::array<int, 6>, 6> graph = { | ||
0, 4, 1, 4, POSITIVE_INFINITY, POSITIVE_INFINITY, | ||
4, 0, 3, 8, 3, POSITIVE_INFINITY, | ||
1, 3, 0, POSITIVE_INFINITY, 1, POSITIVE_INFINITY, | ||
4, 8, POSITIVE_INFINITY, 0, 5, 7, | ||
POSITIVE_INFINITY, 3, 1, 5, 0, POSITIVE_INFINITY, | ||
POSITIVE_INFINITY, POSITIVE_INFINITY, POSITIVE_INFINITY, 7, POSITIVE_INFINITY, 0}; |
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.
Also this should be moved to a test function outside main
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions! |
Description of Change
Fixed a grammar error and solved a naming error.
Checklist
Notes: