クラス LazySegmentTree<T,U extends Comparable<? super U>>
java.lang.Object
library.ds.lazysegmenttree.LazySegmentTree<T,U>
遅延セグ木
- 関連項目:
-
コンストラクタの概要
コンストラクタコンストラクタ説明LazySegmentTree(int n, BinaryOperator<T> f, BiFunction<T, U, T> map, BinaryOperator<U> comp, T e, U id) コンストラクタLazySegmentTree(T[] a, BinaryOperator<T> f, BiFunction<T, U, T> map, BinaryOperator<U> comp, T e, U id) コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明final Tall()全体の二項演算結果を返すfinal void半開区間[l, r)について作用素xを適用するfinal voidk番目の要素に作用素xを適用するfinal void構築final voidclear()要素をリセットするfinal int半開区間[l, x)がfnを満たす最初の要素位置xを返すfinal int半開区間[x, r)がfnを満たす最後の要素位置xを返すfinal Tget(int k) LazySegmentTree[k]を返すfinal Tquery(int l, int r) 半開区間[l, r)についての二項演算結果を返すfinal voidk番目の要素をxに更新するfinal T[]toArray()LazySegmentTreeを配列に変換したものを返すfinal StringtoString()
-
コンストラクタの詳細
-
LazySegmentTree
public LazySegmentTree(int n, BinaryOperator<T> f, BiFunction<T, U, T> map, BinaryOperator<U> comp, T e, U id) コンストラクタ- パラメータ:
n- サイズf- 二項演算map- mappingcomp- compositione- 単位元id-
-
LazySegmentTree
public LazySegmentTree(T[] a, BinaryOperator<T> f, BiFunction<T, U, T> map, BinaryOperator<U> comp, T e, U id) コンストラクタ- パラメータ:
a- ボクシングさせた配列f-map-comp-e-id-
-
-
メソッドの詳細
-
build
構築- パラメータ:
a-
-
set
k番目の要素をxに更新する- パラメータ:
k-x-
-
get
LazySegmentTree[k]を返す- パラメータ:
k-- 戻り値:
- k番目の要素
-
query
半開区間[l, r)についての二項演算結果を返す- パラメータ:
l-r-- 戻り値:
- 半開区間[l, r)について二項演算した結果
-
all
全体の二項演算結果を返す- 戻り値:
- 全体を二項演算した結果
-
apply
k番目の要素に作用素xを適用する- パラメータ:
k-x-
-
apply
半開区間[l, r)について作用素xを適用する- パラメータ:
l-r-x-
-
findFirst
半開区間[l, x)がfnを満たす最初の要素位置xを返す- パラメータ:
l-fn-- 戻り値:
- 半開区間[l, x)がfnを満たす最初の要素位置x if non-existence: n
-
findLast
半開区間[x, r)がfnを満たす最後の要素位置xを返す- パラメータ:
r-fn-- 戻り値:
- 半開区間[x, r)がfnを満たす最後の要素位置x if non-existence: −1
-
clear
public final void clear()要素をリセットする -
toArray
LazySegmentTreeを配列に変換したものを返す- 戻り値:
- LazySegmentTreeの配列
-
toString
-