Skip to content
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

Create bubble_sort_2.py #1

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/codeflash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
id: optimize_code
run: |
poetry env use python
poetry run codeflash --test-framework unittest --test-root code_to_optimize/tests/unittest
poetry run codeflash
3 changes: 3 additions & 0 deletions bubble_sort_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def sorter2(arr):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def sorter2(arr):
def sorter2(arr):\n arr.sort()\n return arr\n
No newline at end of file

arr.sort()
return arr
8 changes: 8 additions & 0 deletions bubble_sort_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def sorter2(arr):
for i in range(len(arr)):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
temp = arr[j]
arr[j] = arr[j + 1]
arr[j + 1] = temp
Comment on lines +2 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i in range(len(arr)):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
temp = arr[j]
arr[j] = arr[j + 1]
arr[j + 1] = temp
arr.sort()

return arr
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tool.poetry]
name = "my-best-repo"
version = "0.1.0"
description = ""
authors = ["afik.cohen <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[tool.poetry.dependencies.codeflash]
url = "https://www.dropbox.com/scl/fi/cc9wktjof4fx6888l2kxe/codeflash-0.0.0-py3-none-any.whl?rlkey=d5jpchx11vlj3l959faw8uqgh&dl=1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


[tool.codeflash]
root = "."
test-root = "tests"
test-framework = "pytest"
ignore-paths = []
Empty file added tests/__init__.py
Empty file.
Loading