Skip to content

Commit

Permalink
sol: lab3/sort
Browse files Browse the repository at this point in the history
  • Loading branch information
jfvillablanca committed Nov 1, 2023
1 parent 4c7ed79 commit 2947b6b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions lab3/sort/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://cs50.harvard.edu/x/2023/labs/3/
20 changes: 20 additions & 0 deletions lab3/sort/answers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sort1 uses: bubble sort
sorted50k 0.590s
random50k 6.027s
reversed50k 5.231s

How do you know?: The best case is a function of n while worst case is of n^2

sort2 uses: merge sort
sorted50k 0.617s
random50k 0.653s
reversed50k 0.619s

How do you know?: The fastest of the 3 sorts and worst and best case is almost the same

sort3 uses: selection sort
reversed50k 2.528s
random50k 2.663s
reversed50k 2.926s

How do you know?: The best case is almost the same as the worst case and it takes a while

0 comments on commit 2947b6b

Please sign in to comment.