Skip to content

Commit d45dc24

Browse files
committed
MD lines ending with two spaces removed
1 parent 78b236e commit d45dc24

File tree

9 files changed

+32
-114
lines changed

9 files changed

+32
-114
lines changed

src/algorithms/explanations/ASTExp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Others of these algorithms work with weighted graphs
1919
where the aim is to find the least cost path(s), while BFS and DFS
2020
ignore edge weights and Prim's
2121
algorithm finds a minumum spanning tree of the graph (the least cost
22-
set of edges that connects all nodes, if the graph is connected).
22+
set of edges that connects all nodes, if the graph is connected).
2323

2424
These graph traversal algorithms can be used for both directed
2525
and undirected graphs; in AIA we use undirected graphs for simplicity.

src/algorithms/explanations/AVLExp original Dec 2024.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/algorithms/explanations/BFSExp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ structure.
1313
Others of these algorithms work with weighted graphs (with positive weights
1414
for all edges), where the aim is to find the least cost path(s), while Prim's
1515
algorithm finds a minumum spanning tree of the graph (the least cost
16-
set of edges that connects all nodes, if the graph is connected).
16+
set of edges that connects all nodes, if the graph is connected).
1717

1818
These graph traversal algorithms can be used for both directed
1919
and undirected graphs; in AIA we use undirected graphs for simplicity.

src/algorithms/explanations/DFSExp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ structure.
1616
Others of these algorithms work with weighted graphs (with positive weights
1717
for all edges), where the aim is to find the least cost path(s), while Prim's
1818
algorithm finds a minumum spanning tree of the graph (the least cost
19-
set of edges that connects all nodes, if the graph is connected).
19+
set of edges that connects all nodes, if the graph is connected).
2020

2121
These graph traversal algorithms can be used for both directed
2222
and undirected graphs; in AIA we use undirected graphs for simplicity.

src/algorithms/explanations/DIJKExp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Others of these algorithms work with weighted graphs
1313
where the aim is to find the least cost path(s), while BFS and DFS
1414
ignore edge weights and Prim's
1515
algorithm finds a minumum spanning tree of the graph (the least cost
16-
set of edges that connects all nodes, if the graph is connected).
16+
set of edges that connects all nodes, if the graph is connected).
1717

1818
These graph traversal algorithms can be used for both directed
1919
and undirected graphs; in AIA we use undirected graphs for simplicity.

src/algorithms/explanations/HSSExp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Horspool's algorithm uses a preprocessing of the pattern P to limit the number of partial matches attempted, compared to the brute-force method.
44
As with the brute-force method, we can think of P as "sliding along" the text T. Horspool's method, however, matches the pattern P from right to left.
55
Its preprocessing generates a Shift Table which gives, for each character, the number of places to shift the pattern along, in case of a failed partial match.
6-
The shift table has a value for every character in the alphabet, including characters that are not in pattern P, but could be in text T. The alphabet contains all characters that might possibly be in the text and pattern.
6+
The shift table has a value for every character in the alphabet, including characters that are not in pattern P, but could be in text T. The alphabet contains all characters that might possibly be in the text and pattern.
77

8-
In this visualization, the alphabet contains all letters in the Roman alphabet (A-Z) plus the Space character. Alphabets might be smaller, e.g. for DNA sequences the alphabet would be the four bases, or they might be larger, e.g. the characters found in English literature, which would include both upper and lower case letters, space, punctuation, numbers, etc.
8+
In this visualization, the alphabet contains all letters in the Roman alphabet (A-Z) plus the Space character. Alphabets might be smaller, e.g. for DNA sequences the alphabet would be the four bases, or they might be larger, e.g. the characters found in English literature, which would include both upper and lower case letters, space, punctuation, numbers, etc.
99

10-
As an example of how the Shift Table is used:
10+
As an example of how the Shift Table is used:
1111

1212
If the pattern is "wally" and matching fails (immediately) because the
1313
'y' gets compared against an 'x' in the text, a character not found in the pattern,
@@ -19,4 +19,4 @@ If the failure was due to comparing 'y' against an 'a', a character
1919
we need to start another attempted match from the rightmost end of the pattern. Where a
2020
character appears repeatedly in the pattern, as 'l' does in the "wally"
2121
example, it is the last occurrence that counts, so in this example
22-
the shift therefore will be 1, not 2.
22+
the shift therefore will be 1, not 2.

src/algorithms/explanations/TCExp.md

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

55
Warshalls algorithm computes the transitive closure of a directed
6-
graph, that is, what nodes can be reached from other nodes.
6+
graph, that is, what nodes can be reached from other nodes.
77

88
The algorithm starts with an adjacency matrix A for a directed graph G
99
with n nodes. In the adjacency matrix, A[i,j] = 1 indicates that
@@ -14,12 +14,12 @@ i to j, possibly with several intermediate steps between i and j.
1414

1515
The algorithm uses three nested loops that iterate over all the nodes
1616
but the order of the nesting is crucial for correctness.
17-
17+
1818
## The logic is as follows.
19-
19+
2020
We start with the matrix describing direct reachability
2121
(using a single edge and no intermediate nodes).
22-
22+
2323
We first compute reachability that may include node 1 as an intermediate node
2424
(as well as direct reachability), then compute reachability that may include
2525
nodes 1 and/or 2, and so on, up to n.

src/algorithms/explanations/TTFExp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ less than the keys in child2.
1515
Three-nodes have two keys and three subtrees, named and
1616
ordered child1, key1, child2, key2, child3. Four-nodes have three keys
1717
and four subtrees, named and ordered child1, key1, child2, key2, child3,
18-
key3, child4.
18+
key3, child4.
1919

2020
For simplicity, equal keys have been ignored in this module. One way of handling duplicate
2121
keys would be to have a linked list of records originating in the node. Alternatively an
@@ -36,7 +36,7 @@ it is simplest to implement the
3636
encountered as we traverse down the tree. There is a more complicated
3737
"bottom up" version that waits to split four-nodes until the split is actually needed. The
3838
"bottom-up" version can slightly reduce the number of nodes in the
39-
tree in some cases, potentially improving efficiency.
39+
tree in some cases, potentially improving efficiency.
4040

4141
---
4242

src/algorithms/explanations/msort_arr_nat.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
---
44

5-
Natural merge sort is a variation of the merge sort algorithm that
6-
takes advantage of the natural order present in the input array.
7-
Natural merge sort scans through the array to identify naturally
8-
occurring sorted sequences (runs) and merges consecutive pairs of
5+
Natural merge sort is a variation of the merge sort algorithm that
6+
takes advantage of the natural order present in the input array.
7+
Natural merge sort scans through the array to identify naturally
8+
occurring sorted sequences (runs) and merges consecutive pairs of
99
runs, until a single run remains.
1010

11-
The merge operation is not in-place - it requires O(n) extra space.
12-
A simple solution (used here) is to merge the two sorted sub-arrays
13-
to a temporary array then copy them back to the original array.
14-
Merge uses three pointers/indices that scan from left to right;
15-
one for each of the input sub-arrays and one for the output array.
16-
At each stage the minimum input array element is copied to the
17-
output array and the indices for those two arrays are incremented.
18-
When one input array has been completely copied, any additional
19-
elements in the other input array are copied to the output array.
11+
The merge operation is not in-place - it requires O(n) extra space.
12+
A simple solution (used here) is to merge the two sorted sub-arrays
13+
to a temporary array then copy them back to the original array.
14+
Merge uses three pointers/indices that scan from left to right;
15+
one for each of the input sub-arrays and one for the output array.
16+
At each stage the minimum input array element is copied to the
17+
output array and the indices for those two arrays are incremented.
18+
When one input array has been completely copied, any additional
19+
elements in the other input array are copied to the output array.
2020

21-
Natural merge sort is stable meaning the relative order of equal
22-
elements is preserved. In the bottom-up merge sort, shown elsewhere,
23-
the starting point assumes each run is one item long. In practice,
24-
random input data will have many short runs that just happen to be
25-
sorted. In the typical case, the natural merge sort may not need
21+
Natural merge sort is stable meaning the relative order of equal
22+
elements is preserved. In the bottom-up merge sort, shown elsewhere,
23+
the starting point assumes each run is one item long. In practice,
24+
random input data will have many short runs that just happen to be
25+
sorted. In the typical case, the natural merge sort may not need
2626
as many passes because there are fewer runs to merge.

0 commit comments

Comments
 (0)