docs: Improve comments and documentation in binary search algorithm#1849
docs: Improve comments and documentation in binary search algorithm#1849ITZ-NIHALPATEL wants to merge 3 commits into
Conversation
Updated the Binary Search function to improve documentation and clarity. Changed the function name to 'binarySearch' and added examples for usage.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1849 +/- ##
==========================================
+ Coverage 85.91% 85.92% +0.01%
==========================================
Files 379 379
Lines 19778 19793 +15
Branches 3016 3016
==========================================
+ Hits 16993 17008 +15
Misses 2785 2785 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Documentation-only update to Recursive/BinarySearch.js that revises the JSDoc block to accurately reflect the current function signature and behavior. The previous JSDoc was outdated (wrong function name BinarySearch, listed low/high before searchValue, and didn't note default parameters), so this brings the docs in line with the implementation binarySearch(arr, searchValue, low = 0, high = arr.length - 1).
Changes:
- Corrects
@functionname tobinarySearch(matching the exported function). - Reorders/clarifies
@paramentries to match the actual parameter order and markslow/highas optional with defaults. - Adds usage
@exampleblocks for both found and not-found cases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Describe your change:
Checklist:
Example:
UserProfile.jsis allowed butuserprofile.js,Userprofile.js,user-Profile.js,userProfile.jsare notFixes: #{$ISSUE_NO}.