Skip to content

Commit

Permalink
v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed Dec 21, 2023
1 parent 8816f67 commit 09217af
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
38 changes: 38 additions & 0 deletions Algorthmic Tests/waveFunction.py
Original file line number Diff line number Diff line change
@@ -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}")
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion Sorting Tests/mergeSort.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
startTimer2 = time.process_time()

# Random numbers in a list
theList = [None]
theList = []

# --- Merge Sort --- #
sortedList = []
Expand Down
12 changes: 3 additions & 9 deletions Sorting Tests/selectionSort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09217af

Please sign in to comment.