problemscpp
A collection of my answers to algorithm problems in c++.
|
#include <leetcode.h>
Public 成员函数 | |
NumArray (vector< int > &nums) | |
Initializes the object with the integer array nums. 更多... | |
int | sumRange (int left, int right) const |
Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]). 更多... | |
Private 属性 | |
vector< int > | pref_sum |
在文件 leetcode.h 第 2267 行定义.
|
explicit |
Initializes the object with the integer array nums.
在文件 leetcode.cpp 第 6055 行定义.
引用了 pref_sum.
int leetcode::range_sum_query_immutable::NumArray::sumRange | ( | int | left, |
int | right | ||
) | const |
Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
在文件 leetcode.cpp 第 6063 行定义.
引用了 acwing::acwing1929::left, pref_sum , 以及 acwing::acwing1929::right.
|
private |
在文件 leetcode.h 第 2268 行定义.
被这些函数引用 NumArray() , 以及 sumRange().