MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / test

Function test

templates/binary-index-tree.cpp:75–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void test(){
76 int n = 100;
77 std::vector<int> v(n);
78
79 for(int i=0; i<n; i++){
80 v[i] = i+1;
81 }
82
83 BinaryIndexedTree b(v);
84 for(int i=0; i<100; i++){
85 int q = i+1;
86 int x = b.Query(q);
87 printf("query %d %d\n", q, x);
88
89 x = b.SumRange(q, q+1);
90 printf("sum %d %d\n", q, x);
91 }
92}
93
94int main()
95{

Callers 1

mainFunction · 0.85

Calls 2

QueryMethod · 0.80
SumRangeMethod · 0.80

Tested by

no test coverage detected