Skip to content

v-tank/fix suggestions #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style(book): better wording for table
  • Loading branch information
amejiarosario committed Mar 23, 2020
commit 9c36253ca49e035ec7c33b07a99e51e8a062ce99
8 changes: 4 additions & 4 deletions book/content/part01/algorithms-analysis.asc
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ To give you a clearer picture of how different algorithms perform as the input s
|=============================================================================================
|Input size -> |10 |100 |10k |100k |1M
|Finding if a number is odd |< 1 sec. |< 1 sec. |< 1 sec. |< 1 sec. |< 1 sec.
|Sorting elements in array with merge sort |< 1 sec. |< 1 sec. |< 1 sec. |few sec. |20 sec.
|Sorting elements in array with Bubble Sort |< 1 sec. |< 1 sec. |2 minutes |3 hours |12 days
|Finding all subsets of a given set |< 1 sec. |40,170 trillion years |> centillion years |∞ |∞
|Find all permutations of a string |4 sec. |> vigintillion years |> centillion years |∞ |∞
|Sorting array with merge sort |< 1 sec. |< 1 sec. |< 1 sec. |few sec. |20 sec.
|Sorting array with Selection Sort |< 1 sec. |< 1 sec. |2 minutes |3 hours |12 days
|Finding all subsets |< 1 sec. |40,170 trillion years |> centillion years |∞ |∞
|Finding string permutations |4 sec. |> vigintillion years |> centillion years |∞ |∞
|=============================================================================================

Most algorithms are affected by the size of the input (`n`). Let's say you need to arrange numbers in ascending order. Sorting ten items will naturally take less time than sorting out 2 million. But, how much longer? As the input size grow, some algorithms take proportionally more time, we classify them as <> runtime [or `O(n)`]. Others might take power two longer; we call them <> running time [or `O(n^2^)`].
Expand Down