Skip to content

Commit 1565c1c

Browse files
committed
Merge pull request kodecocodes#107 from keitaito/patch-for-small-fixes
Fix code snippet and typo
2 parents 72cac4d + d18b611 commit 1565c1c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Boyer-Moore/README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ See also: [a detailed analysis](http://www.inf.fh-flensburg.de/lang/algorithmen/
143143

144144
A variation on the above algorithm is the [Boyer-Moore-Horspool algorithm](https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm).
145145

146-
Like the regular Boyer-Moore algorithm, it uses the `skipTable` to skip ahead a number of characters. The difference is in how we check partial matches. In the above version, it a partial match is found but it's not a complete match, we skip ahead by just one character. In this revised version, we also use the skip table in that situation.
146+
Like the regular Boyer-Moore algorithm, it uses the `skipTable` to skip ahead a number of characters. The difference is in how we check partial matches. In the above version, if a partial match is found but it's not a complete match, we skip ahead by just one character. In this revised version, we also use the skip table in that situation.
147147

148148
Here's an implementation of the Boyer-Moore-Horspool algorithm:
149149

Graph/README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public mutating func connect(sourceVertex: Vertex<T>, to destinationVertex: Vert
234234
adjacencyMatrix[sourceVertex.index][destinationVertex.index] = weight
235235
}
236236

237-
public func weightFrom(sourceVertex: GraphVertex<T>, toDestinationVertex: GraphVertex<T>) -> Double? {
237+
public func weightFrom(sourceVertex: Vertex<T>, toDestinationVertex: Vertex<T>) -> Double? {
238238
return adjacencyMatrix[sourceVertex.index][toDestinationVertex.index]
239239
}
240240
```

Linked List/README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ If you don't have a reference to the node, you can use `removeLast()` or `remove
408408
public func removeAtIndex(index: Int) -> T {
409409
let node = nodeAtIndex(index)
410410
assert(node != nil)
411-
return removeNode(node)
411+
return removeNode(node!)
412412
}
413413
```
414414

0 commit comments

Comments
 (0)