diff --git a/Algorthmic Tests/waveFunction.py b/Algorthmic Tests/waveFunction.py new file mode 100644 index 0000000..7e4922e --- /dev/null +++ b/Algorthmic Tests/waveFunction.py @@ -0,0 +1,38 @@ +import random +import time + + +# Start timer +startTimer = time.perf_counter() +startTimer2 = time.process_time() + +def waveFunc(loopNum): + for loop in range(loopNum): + # Get the mass, Planck's Constant, and etc... + mass = random.randint(1, 500) + v = random.randint(1, 500) + x = random.randint(1, 500) + t = random.randint(1, 360) + i = int(0 + (-1 * 0.5)) + + h = float(6.63) + + # Kentic and Potential engeries + KE = float((-h ** 2 / 2 * mass) * v ** 2) + PE = int(v * (x + t)) + + # Add KE + PE + step1 = float(KE + PE) + + step2 = float((i * h) * (2 / 2 * t)) + + # Get the final value + print(f"SE: {step1 - step2}\n") + +# Run the function with a specific amount of times it will have to repeat the loop +waveFunc(None) + +endTimer = time.perf_counter() +endTimer2 = time.process_time() + +print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}") \ No newline at end of file diff --git a/README.md b/README.md index e4bb414..f4d3e91 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ IDE Links: - Dividing # Sorting Tests -- This category of tests adds two different types of sorting algorithms/tests; selection, merge, and bubble sort. +- This category of tests adds two different types of sorting algorithms/tests; selection, merge, greatest to least and least to greatest, and bubble sort. # General Computer Information - This is Python file allows you to get your computer's CPU and OS information @@ -38,3 +38,19 @@ IDE Links: - CPU Usage - CPU Physical & Logical Cores - Swap Memory + +# Scale +Test | Good | Fast | Slow | Horrible +--- | --- | --- | --- | --- +Merge Sort | 0.0005-0.0003 | 0.0003-Less | 0.0005-Greater | > 1.0 +Greatest And Least Sort | 0.0007-0.0004 | 0.0004-Less | 0.0007-Greater | > 1.0 +Bubble Sort | 0.0002-0.00009 | 0.00009-Less | 0.0002-Greater | > 1.0 +Selection Sort | 0.0003-0.0009 | 0.00009-Less | 0.0004-Greater | > 1.0 +Wave Function | 0.0005-0.0003 | 0.0003-Less | 0.0005-Greater | > 1.0 +Adding | 0.0003-0.0001 | 0.0001-Less | 0.0003-Greater | > 1.0 +Subtracting | 0.0004-0.0001 | 0.0001-Less | 0.0004-Greater | > 1.0 +Multiplying | 0.0005-0.0002 | 0.0002-Less | 0.0005-Greater | > 1.0 +Dividing | 0.0006-0.0001 | 0.0001-Less | 0.0006-Greater | > 1.0 +All Math Test | 0.0005-0.0002 | 0.0002-Less | 0.0005-Greater | > 1.0 +"For" Break Test | 0.00008-0.00005 | 0.00005-Less | 0.00008-Greater | > 1.0 +"For" Test | 0.0003-0.0001 | 0.0001-Less | 0.0003-Greater | > 1.0 \ No newline at end of file diff --git a/Sorting Tests/mergeSort.py b/Sorting Tests/mergeSort.py index f6c9860..2e38643 100644 --- a/Sorting Tests/mergeSort.py +++ b/Sorting Tests/mergeSort.py @@ -6,7 +6,7 @@ startTimer2 = time.process_time() # Random numbers in a list -theList = [None] +theList = [] # --- Merge Sort --- # sortedList = [] diff --git a/Sorting Tests/selectionSort.py b/Sorting Tests/selectionSort.py index c4689c5..53e4938 100644 --- a/Sorting Tests/selectionSort.py +++ b/Sorting Tests/selectionSort.py @@ -10,16 +10,10 @@ # --- Selection Sort --- # sortedList = [] def selectionSort(array = []): - i = 0 for arr in range(len(array)): - if i == len(array): - i = 0 - break - else: - arrMin = min(array) - i += 1 - sortedList.append(arrMin) - listOfNums.remove(arrMin) + arrMin = min(array) + sortedList.append(arrMin) + listOfNums.remove(arrMin) # Give list to the func/algorithm selectionSort(listOfNums)