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 436848d

Browse files
fixes format
1 parent 1d75301 commit 436848d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎book/content/part03/binary-search-tree.asc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ With the methods `add` and `remove`, we have to guarantee that our tree always h
5252
===== Inserting new elements in a BST
5353

5454
.For inserting an element in a BST, we have two scenarios:
55-
1. If the tree is empty (root element is null), we add the newly created node as root, and that's it!
56-
2. If the tree has a root, compare the new value with the root. Then we have three possibilities:
57-
2.1. `root == newValue`: we increase the duplicity counter in that case, and done!
58-
2.2 `root > newValue`, we search on the left side of the root.
59-
2.3 `root < newValue`, we search on the right side of the root.
60-
3. Repeat the comparison between the current node and `newValue`, until we find the value or (null) space.
55+
. If the tree is empty (root element is null), we add the newly created node as root, and that's it!
56+
. If the tree has a root, compare the new value with the root. Then we have three possibilities:
57+
.. `root == newValue`: we increase the duplicity counter in that case, and done!
58+
.. `root > newValue`, we search on the left side of the root.
59+
.. `root < newValue`, we search on the right side of the root.
60+
. Repeat the comparison between the current node and `newValue`, until we find the value or (null) space.
6161

6262
For instance, let’s say that we want to insert the values 19, 21, 10, 2, 18 in a BST:
6363

‎book/content/part03/graph.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ include::{codedir}/data-structures/graphs/node.js[tag=removeAdjacent, indent=0]
297297
.2+.^s| Data Structure 2+^s| Vertices 2+^s| Edges .2+^.^s| Space Complexity
298298
^|_Add_ ^|_Remove_ ^|_Add_ ^|_Remove_
299299
| Graph (adj. matrix) ^| O(\|V\|^2^) ^| O(\|V\|^2^) ^|O(1) ^|O(1) ^|O(\|V\|^2^)
300-
| Graph (adj. list w/array) ^| O(1) ^| O(\|V\| + \|E\|)) ^|O(1) ^|O(\|V\| + \|E\|) ^|O(\|V\| + \|E\|)
300+
| Graph (adj. list w/array) ^| O(1) ^| O(\|V\| + \|E\|)) ^|O(1) ^|O(\|E\|) ^|O(\|V\| + \|E\|)
301301
| Graph (adj. list w/HashSet) ^| O(1) ^| O(\|V\|)) ^|O(1) ^|O(1) ^|O(\|V\| + \|E\|)
302302
|===
303303
// end::table[]

0 commit comments

Comments
(0)

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