-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ ♻️ : Made Code Cleaner and easy to access! (#179)
* +⚰: Cleaned Code * + ♻️ : Moved souvikchand/gists to right place. he put gist-solutions.md on the repo home moved to contributors/ @souvikchand. * + 📄 : Update LICENSE 2023-> 2024 * + ♻️ : Moved Ashmita001 to Right Place She had is in contributors/ base not in the contributors/Ashmita001 So, i moved for better clarity. @Ashmita001
- Loading branch information
1 parent
d98f099
commit 5ade474
Showing
12 changed files
with
26 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 25 additions & 25 deletions
50
gist-solutions.md → contributors/souvikchand/gist-solutions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
https://github.com/souvikchand/oss101-forked/blob/souvikchand-details/gist-solutions.md | ||
def binary_search(arr, target): | ||
""" | ||
Perform binary search on a sorted array. | ||
|
||
Parameters: | ||
- arr (list): The sorted array to search. | ||
- target: The target element to find in the array. | ||
|
||
Returns: | ||
- int: The index of the target element if found, otherwise -1. | ||
""" | ||
low, high = 0, len(arr) - 1 | ||
|
||
while low <= high: | ||
mid = (low + high) // 2 | ||
|
||
if arr[mid] == target: | ||
return mid | ||
elif arr[mid] < target: | ||
low = mid + 1 | ||
else: | ||
high = mid - 1 | ||
|
||
return -1 | ||
https://github.com/souvikchand/oss101-forked/blob/souvikchand-details/gist-solutions.md | ||
def binary_search(arr, target): | ||
""" | ||
Perform binary search on a sorted array. | ||
|
||
Parameters: | ||
- arr (list): The sorted array to search. | ||
- target: The target element to find in the array. | ||
|
||
Returns: | ||
- int: The index of the target element if found, otherwise -1. | ||
""" | ||
low, high = 0, len(arr) - 1 | ||
|
||
while low <= high: | ||
mid = (low + high) // 2 | ||
|
||
if arr[mid] == target: | ||
return mid | ||
elif arr[mid] < target: | ||
low = mid + 1 | ||
else: | ||
high = mid - 1 | ||
|
||
return -1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.