Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 790 Bytes

number_of_elements.md

File metadata and controls

30 lines (20 loc) · 790 Bytes

Number Of Elements

To create an R*-tree, we use RTree::new(). Then we can use size() to obtain the number of elements stored in the R*-tree.

The complete code is presented below:

use rstar::RTree;

fn main() {
    let tree: RTree<(i32, i32)> = RTree::new();
    println!("{}", tree.size());
}

In the code, we assume we are going to store points of type (i32, i32).

Output:

0

It outputs 0 because there is no points in the tree. We will talk about point insertions later.

➡️ Next: Element Iterations

📘 Back: Table of contents