Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9c36253

Browse files
style(book): better wording for table
1 parent 19ff1f0 commit 9c36253

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎book/content/part01/algorithms-analysis.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ To give you a clearer picture of how different algorithms perform as the input s
5959
|=============================================================================================
6060
|Input size -> |10 |100 |10k |100k |1M
6161
|Finding if a number is odd |< 1 sec. |< 1 sec. |< 1 sec. |< 1 sec. |< 1 sec.
62-
|Sorting elements in array with merge sort |< 1 sec. |< 1 sec. |< 1 sec. |few sec. |20 sec.
63-
|Sorting elements in array with Bubble Sort |< 1 sec. |< 1 sec. |2 minutes |3 hours |12 days
64-
|Finding all subsets of a given set |< 1 sec. |40,170 trillion years |> centillion years |∞ |∞
65-
|Find all permutations of a string |4 sec. |> vigintillion years |> centillion years |∞ |∞
62+
|Sorting array with merge sort |< 1 sec. |< 1 sec. |< 1 sec. |few sec. |20 sec.
63+
|Sorting array with Selection Sort |< 1 sec. |< 1 sec. |2 minutes |3 hours |12 days
64+
|Finding all subsets |< 1 sec. |40,170 trillion years |> centillion years |∞ |∞
65+
|Finding string permutations |4 sec. |> vigintillion years |> centillion years |∞ |∞
6666
|=============================================================================================
6767

6868
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 <<part01-algorithms-analysis#linear, linear>> runtime [or `O(n)`]. Others might take power two longer; we call them <<part01-algorithms-analysis#quadratic, quadratic>> running time [or `O(n^2^)`].

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /