Skip to content

Commit 28b17cf

Browse files
committed
docs: align doc variable names with code
Doc comments referenced le/ri while the actual parameters and loop variables are named l/r. Also fix the functional graph doc to name the returned childs member, correct the find_substr comment, and reformat the cart_k_ary_tree example block.
1 parent b9d7aed commit 28b17cf

7 files changed

Lines changed: 18 additions & 19 deletions

File tree

library/graphs/uncommon/functional_graph_processor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! bool is_on_cycle = (v == root);
99
//! @endcode
1010
//! root = first reachable node on cycle from v
11-
//! t[v].childs = forest of reversed edges not in cycles
11+
//! childs = forest of reversed edges not in cycles
1212
//! @time O(n)
1313
//! @space O(n)
1414
auto func_graph(const vi& a) {

library/loops/quotients.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#pragma once
22
//! https://github.com/tfg50/Competitive-Programming/blob/master/Biblioteca/Math/DivisionTrick.cpp
3-
//! i-th iteration gives an interval [le_i, ri_i]:
4-
//! - for all i in [le_i, ri_i]: n / i is the same
5-
//! - le_0 = 1
6-
//! - ri_last = n
7-
//! - ri_i + 1 = le_(i+1)
3+
//! i-th iteration gives an interval [l_i, r_i]:
4+
//! - for all i in [l_i, r_i]: n / i is the same
5+
//! - l_0 = 1
6+
//! - r_last = n
7+
//! - r_i + 1 = l_(i+1)
88
//! @time O(sqrt(n))
99
//! @space O(1)
1010
for (ll l = 1, r; l <= n && (r = n / (n / l)); l = r + 1)

library/monotonic_stack/cartesian_binary_tree.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include "monotonic_stack.hpp"
33
//! @code
44
//! // right-most min is root
5-
//! auto le = mono_st(a, less());
6-
//! auto p = cart_binary_tree(le);
5+
//! auto l = mono_st(a, less());
6+
//! auto p = cart_binary_tree(l);
77
//!
88
//! // less_equal() -> left-most min is root
99
//! // greater() -> right-most max is root

library/monotonic_stack/cartesian_k_ary_tree.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
//! p[5] = 9
2121
//!
2222
//! @code
23-
//! auto le = mono_st(a, less()), p =
24-
//! cart_k_ary_tree(a, le); // min cart tree auto le =
25-
//! mono_st(a, greater()), p = cart_k_ary_tree(a, le);
26-
//! // max cart tree bool is_node = (p[i] < i || a[i]
27-
//! != a[p[i]]);
23+
//! auto l = mono_st(a, less()); // min cart tree
24+
//! auto l = mono_st(a, greater()); // max cart tree
25+
//! auto p = cart_k_ary_tree(a, l);
26+
//! bool is_node = (p[i] < i || a[i] != a[p[i]]);
2827
//! @endcode
2928
//!
3029
//! @param a,l array and its left-monotonic stack

library/monotonic_stack/monotonic_range.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#pragma once
22
#include "monotonic_stack.hpp"
33
//! @code
4-
//! vector<int> le = mono_st(a, less()),
5-
//! ri = mono_range(le);
4+
//! vector<int> l = mono_st(a, less()),
5+
//! r = mono_range(l);
66
//! // less_equal(), greater(), greater_equal()
77
//! @endcode
88
//! when cmp == less():
9-
//! a[le[i]] < a[i] >= a[ri[i]]
9+
//! a[l[i]] < a[i] >= a[r[i]]
1010
//! @time O(n)
1111
//! @space O(n)
1212
vi mono_range(const vi& l) {

library/monotonic_stack/monotonic_stack.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#pragma once
22
//! @code
3-
//! vector<int> le = mono_st(a, less());
3+
//! vector<int> l = mono_st(a, less());
44
//! // less_equal(), greater(), greater_equal()
55
//! @endcode
66
//! when cmp == less():
7-
//! a[le[i]] < a[i]
7+
//! a[l[i]] < a[i]
88
//! @time O(n)
99
//! @space O(n)
1010
vi mono_st(const auto& a, const auto& cmp) {

library/strings/suffix_array/find/find_substring.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! requires s_l < n
99
//! for all i in [sa_le,sa_ri): s.substr(s_l,s_r-s_l)
1010
//! == s.substr(sa[i],s_r-s_l)
11-
//! - `r-l` is the # of matches of
11+
//! - `sa_ri-sa_le` is the # of matches of
1212
//! s.substr(s_l, s_r - s_l) in s.
1313
//! @time O(log(|s|))
1414
//! @space O(1)

0 commit comments

Comments
 (0)