-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Conversation
@@ -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=",") |
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.
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.
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.
Okay . Thanks a lot for the obersvation. Will do the changes
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 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=",") |
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.
Okay . Thanks a lot for the obersvation. Will do the changes
…#1401) * added timer in bubble sort * Updated time of execution * import time in main only * Update bubble_sort.py * start = time.process_time()
A timer has been added which calculates the time of execution of a sort , i.e. bubble sort.