hacktoberfest icon indicating copy to clipboard operation
hacktoberfest copied to clipboard

iterative_binarysearch

Open shivamdroidoreo opened this issue 1 year ago • 3 comments

Improvements: Use of <bits/stdc++.h>: This header includes all standard library headers, which can increase compilation time unnecessarily. It is better to include only the specific headers you need, in this case, .

Pass large arrays by reference: While this is not strictly necessary in this small example, for large arrays, it is generally more efficient to pass them by reference rather than by value.

Variable naming: Use more descriptive variable names, such as left, right, and mid, instead of abbreviations like l, r, and m. This enhances code readability.

Edge case handling: The code does not have any significant flaws in logic, but ensuring that it's applied only on sorted arrays is important in practice. Perhaps adding a comment about it or including an assertion that checks if the array is sorted might help in larger projects.

shivamdroidoreo avatar Oct 02 '24 10:10 shivamdroidoreo

Please assign this to me

Arhaan-P avatar Oct 05 '24 11:10 Arhaan-P

To solve this issue in a simpler and easier manner, we can refactor the code to include the necessary headers, pass arrays by reference, and use descriptive variable names. Kindly assign this issue to me!

TusharNaugain avatar Oct 08 '24 12:10 TusharNaugain

pls give this issue to me

siabatra avatar Oct 11 '24 07:10 siabatra