Skip to content

Commit f75c9e8

Browse files
committed
Add link to rosettacode.org
1 parent 141c8df commit f75c9e8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Big-O Notation.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Big-O | Name | Description
1414
**O(n log n)** | "linearithmic" | **Decent performance.** This is slightly worse than linear but not too bad. Example: the fastest general-purpose sorting algorithms.
1515
**O(n^2)** | quadratic | **Kinda slow.** If you have 100 items, this does 100^2 = 10,000 units of work. Doubling the number of items makes it four times slower (because 2 squared equals 4). Example: algorithms using nested loops, such as insertion sort.
1616
**O(n^3)** | cubic | **Poor performance.** If you have 100 items, this does 100^3 = 1,000,000 units of work. Doubling the input size makes it eight times slower. Example: matrix multiplication.
17-
**O(2^n)** | exponential | **Very poor performance.** You want to avoid these kinds of algorithms, but sometimes you have no choice. Example: traveling salesperson problem.
17+
**O(2^n)** | exponential | **Very poor performance.** You want to avoid these kinds of algorithms, but sometimes you have no choice. Adding just one bit to the input doubles the running time. Example: traveling salesperson problem.
1818
**O(n!)** | factorial | **Intolerably slow.** It literally takes a million years to do anything.
1919

2020
Often you don't need math to figure out what the Big-O of an algorithm is but you can simply use your intuition. If your code uses a single loop that looks at all **n** elements of your input, the algorithm is **O(n)**. If the code has two nested loops, it is **O(n^2)**. Three nested loops gives **O(n^3)**, and so on.

README.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ The following books are available for free online:
188188
- [Algorithms + Data Structures = Programs](http://www.ethoberon.ethz.ch/WirthPubl/AD.pdf) by Wirth
189189
- Algorithms and Data Structures: The Basic Toolbox by Mehlhorn and Sanders
190190

191-
Friends of the club:
191+
Other algorithm repositories:
192192

193193
- [EKAlgorithms](https://github.com/EvgenyKarkan/EKAlgorithms). A great collection of algorithms in Objective-C.
194+
- [Rosetta Code](http://rosettacode.org). Implementations in pretty much any language you can think of.
194195

195196
## License
196197

0 commit comments

Comments
 (0)