Skip to content

Commit 35ad583

Browse files
committed
Merge branch 'feature/docs' into develop
2 parents 4fe9bc8 + e2512c8 commit 35ad583

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ MutableValueGraph<City, Distance> roads = ValueGraphBuilder.directed()
226226

227227
**Graph algorithms**
228228

229-
- A\* search algorithm: A single-pair shortest path algorithm. This is a variant of Dijkstra's algorithm using heuristics to try to speed up the search.
229+
- A\* search algorithm, CCSP#2.2.5: A single-pair shortest path algorithm. This is a variant of Dijkstra's algorithm using heuristics to try to speed up the search.
230230
- Bellman-Ford algorithm, CLRS#24.1: [c++](cpp-algorithm/src/graph), [java](java-algorithm/src/main/java/com/example/algorithm/graph) | A single source the shortest path algorithm that can handle negative edge weights. It finds the shortest path from a source vertex to all other vertices in a weighted graph.
231231
232232
```txt
@@ -250,7 +250,7 @@ algorithm BellmanFord(G, source):
250250
return true
251251
```
252252
253-
- Breadth-first search (BFS), CLRS#22.2, CCSP#4.3.1: [c++](cpp-algorithm/src/graph), [java](java-algorithm/src/main/java/com/example/algorithm/graph), [python(test)](python-algorithm/algorithm/graph/test) | A search algorithm that traverses a graph layer by layer. Check the shortest path and compute the distance from the source vertex to all other vertices.
253+
- Breadth-first search (BFS), CLRS#22.2, CCSP#2.2.4, CCSP#4.3.1: [c++](cpp-algorithm/src/graph), [java](java-algorithm/src/main/java/com/example/algorithm/graph), [python(test)](python-algorithm/algorithm/graph/test) | A search algorithm that traverses a graph layer by layer. Check the shortest path and compute the distance from the source vertex to all other vertices.
254254
255255
```txt
256256
algorithm BFS(G, source):
@@ -275,7 +275,7 @@ algorithm BFS(G, source):
275275
u.color = BLACK
276276
```
277277
278-
- Depth-first search (DFS), CLRS#22.3: [c++](cpp-algorithm/src/graph), [java](java-algorithm/src/main/java/com/example/algorithm/graph) | A search algorithm that traverses a graph by exploring as far as possible along each branch before backtracking. Check to exists cycle in a graph.
278+
- Depth-first search (DFS), CLRS#22.3, CCSP#2.2.3: [c++](cpp-algorithm/src/graph), [java](java-algorithm/src/main/java/com/example/algorithm/graph) | A search algorithm that traverses a graph by exploring as far as possible along each branch before backtracking. Check to exists cycle in a graph.
279279
280280
```txt
281281
algorithm DFS(G):
@@ -1051,9 +1051,9 @@ Collections.binarySearch(arrayList, 3); // for list
10511051

10521052
**Examples**
10531053

1054+
- DNA search (Search a codon(combinations of three nucleotides) in a gene), CCSP#2.1: [python](python-algorithm/algorithm/search)(`linear_contains`, `binary_contains`) | Search a codon(combinations of three nucleotides) in a gene using linear search and binary search.
10541055
- Find k-th smallest/largest element in an array, EPI#11.8: [c++](cpp-algorithm/src/search)(`FindKthSmallestElement`, `FindKthLargestElement`) | Find the k-th smallest/largest element in an array using the quickselect algorithm (`QuickSelectAlgorithm`).
10551056
- Find the minimum and maximum elements in an array, EPI#11.7: [c++](cpp-algorithm/src/search)(`FindMinMax`)
1056-
- Search a codon(combinations of three nucleotides) in a gene, CCSP#2.1: [python](python-algorithm/algorithm/search)(`linear_contains`, `binary_contains`) | Search a codon(combinations of three nucleotides) in a gene using linear search and binary search.
10571057
- Search an element in generic list, CCSP#2.1: [python](python-algorithm/algorithm/search)(`generic_linear_contains`, `generic_linear_contains`) | Search an element in generic list using linear search and binary search.
10581058
- Search a sorted array for entry equal to its index, EPI#11.2: [c++](cpp-algorithm/src/search)(`SearchEntryEqualToItsIndex`)
10591059
- Search a sorted array for the first greater than a key: [c++](cpp-algorithm/src/search)(`SearchFirstGreaterThanKey`)

python-algorithm/algorithm/dp/fibonacci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def fibonacci_generator(n: int) -> Generator[int, None, None]:
6363
"""
6464
Calculate the Fibonacci number of the given number using generator approach.
6565
:param n: input number
66-
:return: Fibonacci number
66+
:return: generator of Fibonacci numbers
6767
"""
6868
yield 0 # special case
6969
if n > 0:

python-algorithm/algorithm/math/greatest_common_divisor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def gcd_euclidean(a: int, b: int) -> int:
22
"""
33
Find the greatest common divisor of two numbers using the Euclidean algorithm.
4-
:param a: number
4+
:param a: dividend
55
:param b: divisor
66
:return: the greatest common divisor
77
"""
@@ -14,7 +14,7 @@ def gcd_euclidean_divmod(a: int, b: int) -> int:
1414
"""
1515
Find the greatest common divisor of two numbers using the Euclidean algorithm.
1616
If the numbers are large, use divmod to calculate them.
17-
:param a: number
17+
:param a: dividend
1818
:param b: divisor
1919
:return: the greatest common divisor
2020
"""
@@ -26,7 +26,7 @@ def gcd_euclidean_divmod(a: int, b: int) -> int:
2626
def gcd_extended_euclidean(a: int, b: int) -> tuple:
2727
"""
2828
Find the greatest common divisor of two numbers using the extended Euclidean algorithm.
29-
:param a: number
29+
:param a: dividend
3030
:param b: divisor
3131
:return: the greatest common divisor, x, y (where ax + by = gcd(a, b))
3232
"""

0 commit comments

Comments
 (0)