-
-
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
docs: documentation improvements in search/linear_search.cpp
#1641
Conversation
Update readability of code
search/linear_search.cpp
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.
Hi,
May I suggest some improvements to this code?
Thanks.
search/linear_search.cpp
Outdated
@@ -32,7 +35,7 @@ int main() { | |||
int *array = new int[size]; | |||
int key; | |||
|
|||
// Input array | |||
/*User gets to input array elements*/ | |||
std::cout << "\nEnter the Array of " << size << " numbers : "; |
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.
There should be a check for the user entering a negative number or a very large number as "size" of the array of numbers.
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.
LGTM 🚀 Thank you for your contribution! 😄👍
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 provide the test cases also @ritikaa17. Thanks
TheAlgorithms#1641)" This reverts commit 18e8625.
Update readability of code
Description of Change
Checklist
Notes: