-
Notifications
You must be signed in to change notification settings - Fork 1
Testing #71
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
base: main
Are you sure you want to change the base?
Testing #71
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,96 @@ | ||||||
| """ | ||||||
| Merge Sort Algorithm Implementation | ||||||
|
|
||||||
| MEMORY: This file contains a simple merge sort implementation in Python. | ||||||
| The merge sort algorithm uses a divide-and-conquer approach to sort arrays | ||||||
| by recursively dividing the array into halves, sorting each half, and then | ||||||
| merging them back together in sorted order. Time complexity: O(n log n), | ||||||
| Space complexity: O(n). | ||||||
| """ | ||||||
|
|
||||||
| def merge_sort(arr): | ||||||
| """ | ||||||
| Sort an array using the merge sort algorithm. | ||||||
|
|
||||||
| Args: | ||||||
| arr (list): The array to be sorted | ||||||
|
|
||||||
| Returns: | ||||||
| list: A new sorted array | ||||||
| """ | ||||||
| # Base case: arrays with 1 or 0 elements are already sorted | ||||||
| if len(arr) <= 1: | ||||||
| return arr | ||||||
|
||||||
| return arr | |
| return arr.copy() |
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.
The module docstring includes an internal-sounding "MEMORY:" marker. This reads like an instruction/annotation rather than user-facing documentation; please remove it or rephrase it as normal descriptive text so it doesn’t leak internal metadata into the codebase.