We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 134a325 commit 03c78afCopy full SHA for 03c78af
Sorting-Searching-Algorithm-Tester.py
@@ -81,21 +81,23 @@ def binary_search(arr, low, high):
81
if __name__ == "__main__":
82
array = []
83
84
- itemWanted = 10
85
- length_of_list = 100000
+ itemWanted = 10854# Item you want to search for
+ length_of_list = 10000000# Amount of entries you want in your dataset
86
87
- # fills an array with random numbers from range specified
+ # Fills an array with random numbers from range specified
88
for x in range(length_of_list):
89
array.append(random.randint(0,length_of_list))
90
start_time = time.time()
91
- # sorting algorithm
+
92
+ # Add Sorting Algo of choice
93
94
quick_sort(array,0,len(array)-1)
95
96
past_time=time.time() - start_time
97
98
99
print("--- %s seconds to sort ---" % (time.time() - start_time))
- # searching algorithm
100
+ # Add Searching Algo of choice
101
binary_search(array,0,len(array)-1)
102
103
print("--- %s seconds to find ---" % ((time.time() - start_time) - past_time))
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments