Skip to content

Commit 2d1470a

Browse files
committed
--wip-- [skip ci]
1 parent 29f374a commit 2d1470a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

book/content/part01/algorithms-analysis.asc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ Before going deeper into space and time complexity, let's cover the basics real
2828

2929
Algorithms (as you might know) are steps of how to do some tasks. When you cook, you follow a recipe (or an algorithm) to prepare a dish. Let's say you want to make a pizza.
3030

31-
.Example of an algorithm
31+
.Example of an algorithm to make pizza
3232
[source, javascript]
3333
----
34-
import { punchDown, rollOut, applyToppings, Oven } from '../pizza-utils';
34+
import { rollOut, applyToppings, Oven } from '../pizza-utils';
3535
3636
function makePizza(dough, toppings = ['cheese']) {
3737
const oven = new Oven(450);
38-
const punchedDough = punchDown(dough);
39-
const rolledDough = rollOut(punchedDough);
38+
const rolledDough = rollOut(dough);
4039
const rawPizza = applyToppings(rolledDough, toppings);
4140
const pizzaPromise = oven.bake(rawPizza, { minutes: 20 });
4241
return pizzaPromise;

book/content/part01/how-to-big-o.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ T(n) = n * [t(statement 1) + m * t(statement 2...3)]
111111
Assuming the statements from 1 to 3 are `O(1)`, we would have a runtime of `O(n * m)`.
112112
If instead of `m`, you had to iterate on `n` again, then it would be `O(n^2)`. Another typical case is having a function inside a loop. Let's see how to deal with that next.
113113

114+
[[big-o-function-statement]]
114115
*Function call statements*
115116

116117
When you calculate your programs' time complexity and invoke a function, you need to be aware of its runtime. If you created the function, that might be a simple inspection of the implementation. However, if you are using a library function, you might infer it from the language/library documentation.
649 Bytes
Loading
2.65 KB
Loading

book/part02-linear-data-structures.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
Data Structures comes in many flavors. There’s no one to rule them all. You have to know the tradeoffs so you can choose the right one for the job.
55

6-
Even though in your day-to-day, you might not need to re-implementing them, knowing how they work internally would help you know when to use one over the other or even tweak them to create a new one. We are going to explore the most common data structures' time and space complexity.
6+
Even though in your day-to-day, you might not need to re-implementing them, knowing how they work internally would help you to calculate the time complexity of your code (Remember the chapter <<big-o-function-statement, How to determine Big-O from code?>>).
7+
Also, when you are aware of the data structures implementations, you spot when to use one over the another or even extend them to create a new one. We are going to explore the most common data structures' time and space complexity.
78

89
.In this part we are going to learn about the following linear data structures:
910
- <<array-chap>>
@@ -22,6 +23,7 @@ If you want to have a general overview of each one, take a look at the following
2223
+++
2324
endif::[]
2425

26+
<<<
2527
include::content/part02/array.asc[]
2628

2729
<<<
@@ -35,5 +37,3 @@ include::content/part02/queue.asc[]
3537

3638
<<<
3739
include::content/part02/array-vs-list-vs-queue-vs-stack.asc[]
38-
39-

0 commit comments

Comments
 (0)