From d8c92a5fc39e234a3187ea2e202a09f6d54d36dc Mon Sep 17 00:00:00 2001 From: Retiago Drago <36787606+ranggakd@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:30:30 +0700 Subject: [PATCH 1/5] adding image illustration on explanable markdown --- big.png | Bin 0 -> 13447 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 big.png diff --git a/big.png b/big.png new file mode 100644 index 0000000000000000000000000000000000000000..879b6234832ffb5583f27d11b1c6e8638abd772f GIT binary patch literal 13447 zcmeHuS5#Bm8g3LpLBU256m*NIfPi$6CMwc90qIIls2Xah8?XSMpcz3dJxD- z3@ZS;L~FAx}8xV2gt7tjqnk&g1hY0gL_U zIJ5~K<9Om>-CqSKA&{@?Zz~l}fV(fgU;r+YJi&b6MfDRM@QZ>H&ww3(tX@)N0T+v# z|N8tXD0tx=mPy?xp^N|fPygG9|1S}dgSYSIii?k*Hi1Bx?*;P(l^Np9U~kT`|NQqG zAl&}jux$KmHa{akM8a;!H@^%T=r7Mq@2V!|$&M z*H<4O?c0$t(3!W_14^3DD;&7>Wh&D2k$k-nQ?J=j9OCdFzi44YrM5G>vl){5c^bkK z{@ZDcXxp}r!kY_ZQ90zs{X}!mWV9g`B~$hMa3%0q^zmCJ@o4$I0-2K#YP#O+HY|Gf z0wv)Lr?GP>a~>HO^_fkZF{<5*mtHFQt>s56N;^WMOG0|=`?baM&qm$an@Mr)$W#pJ zI4e~Be2X%+7?qdTTru_LYR58RB7N)6T3mhU$-O>pg|uZy<4=!h*9U8l$mgy}-Jf1e zR0XH{@Wszw1rZm@Xl0&uhP=ebX^GL9x5=XRsLNVXb?2_j%QnaGDID!&SI(yUc7Q*Q z+oG`jt>u|iM3=C({H{$@aq9rqv@=q2+~KjiVod-zS&3jihR_F;>wc?>>suqPRouz= z=XEC$Gs*TSkHvvX?#k`yL`#%w?co4kv<$1%I-_#SvQbpt3#JsFn*tkvm;UqZ^0L22S7C7tTz>cW zWtkGS#DnI@tM(7PC`*+1;{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%*(smB{hmv17;p8!eeO9M zeM=b_Zy7$vA=Yxu=XWgS4CEGIa4Ll*A$-&sxu8_H`Rf3;{&&wB{NoqQ|9Syz@jO7Z zDQ98=fud+PVLG4il@{`^2OGZS27>kf_xQqpY5@K3;gA2%Pr;mLUq9Xw`A8>`1gQcM P2~kzjdV+iOJox_rZxnF_ literal 0 HcmV?d00001 From 727b8b6828d322b193aa4b596da67491763ad9cf Mon Sep 17 00:00:00 2001 From: Retiago Drago <36787606+ranggakd@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:32:14 +0700 Subject: [PATCH 2/5] Putting a new introduction and explanation about big notation --- README.md | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b29047e..8eaf260 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,135 @@ -BigOCheatSheet -============== -[https://www.bigocheatsheet.com/](https://www.bigocheatsheet.com/) +# BigOCheatSheet + +* [Introduction](#introduction) +* [Asymptotic Computational Complexity](#asymptotic-computational-complexity) +* [Asymptote](#asymptote) +* [Asymptotic Analysis](#asymptotic-analysis) +* [Big O](#big-o) +* [Big Omega](#big-ω) +* [Big Theta](#big-θ) +* [The Differences Between These Three](#the-differences-between-these-three) +* [The Worst, Best, Average/Expected Case Context](#the-worst-best-averageexpected-case-context) +* [References](#references) + +## Introduction + +Before we head into the website, we need to know what is __Asymptotic Computational Complexity__ first. If you were already familiar with this term, just skip and jump into the [Big-O Cheat Sheet Website](https://www.bigocheatsheet.com/). + +![illustration_big_notation](big.png) + +**[🔝 back to top](#bigocheatsheet)** + +## Asymptotic Computational Complexity + +> In computational complexity theory, __asymptotic computational complexity__ is the usage of __asymptotic analysis__ for _the estimation of computational complexity of algorithms and computational problems_, commonly associated with the usage of the big O notation. - [Wikipedia](https://en.wikipedia.org/wiki/Asymptotic_computational_complexity) + +To understand those terms, we need to know what is an __Asymptote__ first before we deep dive into __Asymptotic Analysis__. + +**[🔝 back to top](#bigocheatsheet)** + +## Asymptote + +> In analytic geometry, an __asymptote__ of a curve is a line such that the distance between the curve and the line approaches zero as one or both of the x or y coordinates tends to infinity. - [Wikipedia](https://en.wikipedia.org/wiki/Asymptote) + +Here's a visual example from [jarednielsen](https://jarednielsen.com/static/32c1589243f13448fac04d22cb735af9/40601/desmos-asymptote-01.png) + + y = 1/x +![function of 1/x](https://jarednielsen.com/static/32c1589243f13448fac04d22cb735af9/40601/desmos-asymptote-01.png) + +> __No matter how large (or small) the value of x, our curve will never touch the x or y axes__. Even if that number is Infinity. 🐢🏃‍♀️. Especially if that number is zero. Why? It’s mathematically impossible to divide by 0. In the chart above, __the x and y axes__ are the __asymptotes of the equation `y = 1 / x`__. But any line can be an asymptote. We’re not limited to horizontal and vertical lines. - [jarednielsen](https://jarednielsen.com/big-o-omega-theta/) + +Now we get the idea of an __asymptote__, let's continue to learn about __Asymptotic Analysis__. + +**[🔝 back to top](#bigocheatsheet)** + +## Asymptotic Analysis + +> In mathematical analysis, __asymptotic analysis__, also known as __asymptotics__, is _a method of describing limiting behavior_. - [Wikipedia](https://en.wikipedia.org/wiki/Asymptotic_analysis) + +For example, we get from [jarednielsen](https://jarednielsen.com/big-o-omega-theta/). +Given this function `f(x) = x^2 + 2x` , `x` increases in value (approaches infinity) and `2x` becomes insignificant compared to `x^2`. We then simply say that `f(x)` is __asymptotically__ equivalent to `x^2` + +Why do we need this __asymptotic analysis__ you might ask? + +Because we need to estimate the computational complexity of algorithms and computational problems. To get everyone on the same page, we use these notations: __big O, big Ω and big θ__ to describe a different type of estimation. + +**[🔝 back to top](#bigocheatsheet)** + +## Big O + +> __Big O__ describes __the upper bound__ of an algorithm. This is why, for us, as developers and practitioners, we are primarily concerned with Big O. We want to know just how _poorly an algorithm might perform_. - [jarednielsen](https://jarednielsen.com/big-o-omega-theta/) + +> It is define as upper bound and __upper bound on an algorithm__ is the most amount of time required (the worst case performance). +__Big O__ notation is used to describe __asymptotic upper bound__. - [GeeksForGeeks](https://www.geeksforgeeks.org/difference-between-big-oh-big-omega-and-big-theta/) + +![bigO_gfg](https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200807150308/3363.png) + +**[🔝 back to top](#bigocheatsheet)** + +## Big Ω + +> __Big Omega__ describes __the lower bound__ of an algorithm. If only life always handed us sorted arrays. 🌼. We can also think of this as our _best-case scenario_. - [jarednielsen](https://jarednielsen.com/big-o-omega-theta/) + +> It is define as lower bound and __lower bound on an algorithm__ is the least amount of time required (the most efficient way possible, in other words best case). +Just like O notation provide an asymptotic upper bound, __Ω notation__ provides __asymptotic lower bound__. - [GeeksForGeeks](https://www.geeksforgeeks.org/difference-between-big-oh-big-omega-and-big-theta/) + +![bigomega_gfg](https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200807150659/3611.png) + +**[🔝 back to top](#bigocheatsheet)** + +## Big θ + +> __Big Theta__ describes __the tight bound__ of an algorithm, it’s limit from above and below. Big Theta is often used to describe _the average, or expected_, case for an algorithm. This isn’t exactly true, but it’s a useful shorthand. - [jarednielsen](https://jarednielsen.com/big-o-omega-theta/) + +> It is define as tightest bound and __tightest bound__ is the best of all the worst case times that the algorithm can take. - [GeeksForGeeks](https://www.geeksforgeeks.org/difference-between-big-oh-big-omega-and-big-theta/) + +![bigtheta_gfg](https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200807150743/36955.png) + +**[🔝 back to top](#bigocheatsheet)** + +## The Differences Between These Three + +| | Big O | Big Ω / Omega | Big θ / Theta | +| --- | --- | --- | --- | +| Condition operator-wise | `<=` | `>=` | `==` +| Rate of growth of an algorithm / data structure | is less than | is greater than | is equal to | +| Bound | upper | lower | above and below | +| Notation | `O(n)` | `Ω(n)` | `θ(n)` | + +**[🔝 back to top](#bigocheatsheet)** + +## The Worst, Best, Average/Expected Case Context + +What is the relationship between +> __best case__ / __worst case__ / __expected case__ + +and + +> __Big O__ / __Big Omega (Ω)__ / __Big Theta (θ)__? + +__There isn’t one__. + +> Equivalencies are often made between __Big O and worst case__, __Big Omega and best case__, and __Big Theta and average case__, but __we can speak of best, worst, and average__ for __each of these notations__. - [jarednielsen](https://jarednielsen.com/big-o-omega-theta/) + +> For example, each of the following statements about __worst case__ are true: +>> Insertion Sort’s worst case rate of growth is __at most__ `O(n^2)` +>> Insertion Sort’s worst case rate of growth is __at least__ `Ω(n)` +>> Insertion Sort’s worst case rate of growth is __exactly__ `Θ(n^2)` + +**[🔝 back to top](#bigocheatsheet)** + +## References + +[Big-O Cheat Sheet Website](https://www.bigocheatsheet.com/) ◽ last accessed 6 September 2022 + +[Asymptotic computational complexity](https://en.wikipedia.org/wiki/Asymptotic_computational_complexity) ◽ last accessed 6 September 2022 + +[Asymptote](https://en.wikipedia.org/wiki/Asymptote) ◽ last accessed 6 September 2022 + +[Asymptotic analysis](https://en.wikipedia.org/wiki/Asymptotic_analysis) ◽ last accessed 6 September 2022 + +[What’s the Difference Between Big O, Big Omega, and Big Theta?](https://jarednielsen.com/big-o-omega-theta/) ◽ last accessed 6 September 2022 + +[Difference between Big Oh, Big Omega and Big Theta](https://www.geeksforgeeks.org/difference-between-big-oh-big-omega-and-big-theta/) ◽ last accessed 6 September 2022 + +**[🔝 back to top](#bigocheatsheet)** \ No newline at end of file From 56ffacab98adcf8933bb86fbb647b08422ed1785 Mon Sep 17 00:00:00 2001 From: Retiago Drago <36787606+ranggakd@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:36:57 +0700 Subject: [PATCH 3/5] minor rephrasing word --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8eaf260..3190a3f 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Just like O notation provide an asymptotic upper bound, __Ω notation__ provides | | Big O | Big Ω / Omega | Big θ / Theta | | --- | --- | --- | --- | -| Condition operator-wise | `<=` | `>=` | `==` +| Conditional operator-wise | `<=` | `>=` | `==` | Rate of growth of an algorithm / data structure | is less than | is greater than | is equal to | | Bound | upper | lower | above and below | | Notation | `O(n)` | `Ω(n)` | `θ(n)` | From b3265a72036646d931940f97bfe3c7d98e05450f Mon Sep 17 00:00:00 2001 From: Retiago Drago <36787606+ranggakd@users.noreply.github.com> Date: Sun, 11 Sep 2022 22:02:02 +0700 Subject: [PATCH 4/5] provide the translations section for inclusiveness --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3190a3f..97eb08e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [The Differences Between These Three](#the-differences-between-these-three) * [The Worst, Best, Average/Expected Case Context](#the-worst-best-averageexpected-case-context) * [References](#references) +* [Translations](#translations) ## Introduction @@ -132,4 +133,9 @@ __There isn’t one__. [Difference between Big Oh, Big Omega and Big Theta](https://www.geeksforgeeks.org/difference-between-big-oh-big-omega-and-big-theta/) ◽ last accessed 6 September 2022 -**[🔝 back to top](#bigocheatsheet)** \ No newline at end of file +**[🔝 back to top](#bigocheatsheet)** + +## Translations + +* :indonesia: **Indonesian:** + * [ranggakd/BigOCheatSheet](https://github.com/ranggakd/BigOCheatSheet) \ No newline at end of file From 40b0d5a672b3dcc366ab6ec0701e314cb31a9fdc Mon Sep 17 00:00:00 2001 From: Retiago Drago <36787606+ranggakd@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:43:15 +0700 Subject: [PATCH 5/5] columns table alignment fixed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97eb08e..ebb47b8 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Just like O notation provide an asymptotic upper bound, __Ω notation__ provides ## The Differences Between These Three | | Big O | Big Ω / Omega | Big θ / Theta | -| --- | --- | --- | --- | +| :--- | :---: | :---: | :---: | | Conditional operator-wise | `<=` | `>=` | `==` | Rate of growth of an algorithm / data structure | is less than | is greater than | is equal to | | Bound | upper | lower | above and below |