Input validation has been added for both the dfs method to check if the vertex is within the valid range and the initEdges method to ensure that the number of vertices is greater than 0. If the input is invalid, it throws an IllegalArgumentException with an appropriate error message.
Fixes #{ISSUE_NUMBER}
By submitting this pull request I confirm I've read and complied with the below declarations.
[x] This pull request has a descriptive title. For example, Added {Algorithm/DS name} [{Language}], not Update README.md or Added new code.
[x] This pull request will be closed if I fail to update it even once in a continuous time span of 7 days.
[ ] This pull request shall only be reviewed and merged once the Travis build passes. No maintainer or supporter shall be obliged to review it before this condition is met.
[ ] I have mentioned the issue number correctly (with hyperlink) in this pull request description.
@sanvi-05 Please refrain from sending pull requests directly. You must first be assigned to a task, after which your pull request will be reviewed and, if approved, merged.
Input validation has been added for both the dfs method to check if the vertex is within the valid range and the initEdges method to ensure that the number of vertices is greater than 0. If the input is invalid, it throws an IllegalArgumentException with an appropriate error message.
Fixes #{ISSUE_NUMBER}
By submitting this pull request I confirm I've read and complied with the below declarations.
Added {Algorithm/DS name} [{Language}]
, notUpdate README.md
orAdded new code
.