Skip to content

Commit fcfe35c

Browse files
samyakpagariyapre-commit-ci[bot]cclaussCaedenPH
authored
For the better understanding of time taken. (TheAlgorithms#6583)
* For the better understanding of time taken. In this change I have initialized a variable p with the value of (1e9+7) and then took the modulus of process time with it . This modification gives better time taken by the process . Firstly it was giving answer in the exponential now it gives in the integer form. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review Co-authored-by: Caeden Perelli-Harris <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Caeden Perelli-Harris <[email protected]>
1 parent b32903d commit fcfe35c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sorts/bubble_sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def bubble_sort(collection):
4949
unsorted = [int(item) for item in user_input.split(",")]
5050
start = time.process_time()
5151
print(*bubble_sort(unsorted), sep=",")
52-
print(f"Processing time: {time.process_time() - start}")
52+
print(f"Processing time: {(time.process_time() - start)%1e9 + 7}")

0 commit comments

Comments
 (0)