Skip to content

The time complexity of every algorithms make its value #1401

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

Merged
merged 5 commits into from
Oct 19, 2019

Conversation

SinghSujitkumar
Copy link
Contributor

A timer has been added which calculates the time of execution of a sort , i.e. bubble sort.

@@ -37,3 +39,4 @@ def bubble_sort(collection):
user_input = input("Enter numbers separated by a comma:").strip()
unsorted = [int(item) for item in user_input.split(",")]
print(*bubble_sort(unsorted), sep=",")
Copy link
Member

Choose a reason for hiding this comment

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

We are also counting the time that the user enters the data. Let’s only count sort time...

Please move line 2 to be just above this line and also indent line 42.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay . Thanks a lot for the obersvation. Will do the changes

Copy link
Contributor Author

@SinghSujitkumar SinghSujitkumar left a comment

Choose a reason for hiding this comment

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

The changes have been made.

@@ -37,3 +39,4 @@ def bubble_sort(collection):
user_input = input("Enter numbers separated by a comma:").strip()
unsorted = [int(item) for item in user_input.split(",")]
print(*bubble_sort(unsorted), sep=",")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay . Thanks a lot for the obersvation. Will do the changes

@cclauss cclauss merged commit 38d7e70 into TheAlgorithms:master Oct 19, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
…#1401)

* added timer in bubble sort

* Updated time of execution

* import time in main only

* Update bubble_sort.py

* start = time.process_time()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants