problemscpp
A collection of my answers to algorithm problems in c++.
Public 成员函数 | 静态 Private 成员函数 | Private 属性 | 所有成员列表
leetcode::count_good_triplets_in_an_array::FenwickTree< T > 模板类 参考

#include <leetcode.h>

Public 成员函数

 FenwickTree (int limit)
 
query (int idx)
 
void update (int idx, T delta)
 

静态 Private 成员函数

static int lowbit (int x)
 

Private 属性

vector< T > arr
 
int limit {}
 

详细描述

template<class T>
class leetcode::count_good_triplets_in_an_array::FenwickTree< T >

在文件 leetcode.h1226 行定义.

构造及析构函数说明

◆ FenwickTree()

template<class T >
leetcode::count_good_triplets_in_an_array::FenwickTree< T >::FenwickTree ( int  limit)
inlineexplicit

成员函数说明

◆ lowbit()

template<class T >
static int leetcode::count_good_triplets_in_an_array::FenwickTree< T >::lowbit ( int  x)
inlinestaticprivate

◆ query()

template<class T >
T leetcode::count_good_triplets_in_an_array::FenwickTree< T >::query ( int  idx)
inline

在文件 leetcode.h1244 行定义.

1244 {
1245 T ans = 0;
1246 for(; idx > 0; idx -= lowbit(idx)) {
1247 ans += arr[idx];
1248 }
1249 return ans;
1250 }

引用了 leetcode::count_good_triplets_in_an_array::FenwickTree< T >::arr , 以及 leetcode::count_good_triplets_in_an_array::FenwickTree< T >::lowbit().

被这些函数引用 leetcode::count_good_triplets_in_an_array::Solution::goodTriplets().

◆ update()

template<class T >
void leetcode::count_good_triplets_in_an_array::FenwickTree< T >::update ( int  idx,
delta 
)
inline

类成员变量说明

◆ arr

template<class T >
vector<T> leetcode::count_good_triplets_in_an_array::FenwickTree< T >::arr
private

◆ limit

template<class T >
int leetcode::count_good_triplets_in_an_array::FenwickTree< T >::limit {}
private

该类的文档由以下文件生成: