File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ namespace alg {
53
53
54
54
public:
55
55
// node and index
56
- struct nr {
56
+ struct Res {
57
57
uint32_t offset;
58
58
int32_t idx;
59
59
};
@@ -79,7 +79,7 @@ namespace alg {
79
79
close (fd);
80
80
}
81
81
82
- nr Search (int32_t x) {
82
+ Res Search (int32_t x) {
83
83
node root = ROOT ();
84
84
return search (root, x);
85
85
}
@@ -113,9 +113,9 @@ namespace alg {
113
113
/* *
114
114
* search a key, returns node and index
115
115
*/
116
- nr search (node x, int32_t k) {
116
+ Res search (node x, int32_t k) {
117
117
int32_t i = 0 ;
118
- nr ret;
118
+ Res ret;
119
119
while (i<x->n && k > x->key [i]) i++;
120
120
121
121
if (i<x->n && k == x->key [i]) { // search in [0,n-1]
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ int main(void) {
13
13
14
14
for (i=0 ;i<1000 ;i++) {
15
15
x.DeleteKey (i);
16
- BTree::nr r = x.Search (i);
16
+ BTree::Res r = x.Search (i);
17
17
if (r.idx == -1 ) {
18
18
printf (" key[%d] removed\n " , i);
19
19
}
You can’t perform that action at this time.
0 commit comments