Skip to content

Commit b699401

Browse files
ClémentClément
authored andcommitted
Fixing links in dictionary.
1 parent 7d30537 commit b699401

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/lectures/data/dictionary.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Then, a dictionary has only two attributes: an array of `Cell`s, and a probe seq
8888
!include`snippetStart="// - and a probe sequence strategy.", snippetEnd="// The ToString method uses String.Format"` code/projects/Dictionary/Dictionary/Dictionary.cs
8989
```
9090

91-
The default size of 31 and the reason why we are using the `NextPrime` method are discussed [further down](#array-size).
91+
The default size of 31 and the reason why we are using the `NextPrime` method are discussed [further down](#how-is-the-size-of-the-array-decided).
9292

9393
#### Computing the index
9494

@@ -113,7 +113,7 @@ We obtain the following, where the details of `CollisionResolution` are not impo
113113
Adding an element is a delicate process.
114114
We only need a key and a value, and then we
115115

116-
- make sure the dictionary does not already contain a key-value pair with the same key ([detailed below](#find)),
116+
- make sure the dictionary does not already contain a key-value pair with the same key ([detailed below](#finding-a-key)),
117117
- compute an index, store it into a variable `index`, and proceed as follows:
118118

119119
As long as the table contains a `Cell` at `index` whose status is not `Deleted` nor `Empty`, we
@@ -132,17 +132,17 @@ We only need a key and a value, and then we
132132
!include`snippetStart="// Adding an element", snippetEnd="// Done with adding an element"` code/projects/Dictionary/Dictionary/Dictionary.cs
133133
```
134134

135-
#### Finding a key {#find}
135+
#### Finding a key
136136

137137
For `find`, we use a subroutine `FindI` that computes the index of a key if it exists, returns -1 otherwise.
138138
The critical point is to understand that we *need to keep looking even if the cell is marked as `deleted`*.
139-
We illustrate this [point below](#deleted).
139+
We illustrate this [point below](#handling-deletion).
140140

141141
```{download="./code/projects/Dictionary.zip"}
142142
!include`snippetStart="// We use a bool Find sub-routine", snippetEnd="// Done with found."` code/projects/Dictionary/Dictionary/Dictionary.cs
143143
```
144144

145-
#### Handling Deleting {#deleted}
145+
#### Handling Deletion
146146

147147
The `Remove` method heavily relies on `FindI`:
148148

@@ -160,7 +160,7 @@ Imagine the following scenario:
160160

161161
This is the reason why we need to keep track of the deleted cells, to make sure `Find` will keep looking because it knows that possibly, when the value with key `"Lora"` was inserted, its index was already taken.
162162

163-
#### How is the size of the array decided? {#array-size}
163+
#### How is the size of the array decided?
164164

165165
The size of the array will in general be a prime number. This is discussed in detail [on stackexchange](https://cs.stackexchange.com/a/64191), but can be easily illustrated.
166166
Let us assume that our dictionary

0 commit comments

Comments
 (0)