Implementation of Policy based Data Structure in fastUtil library.

12 views
Skip to first unread message

Satyam Jha

unread,
Jan 26, 2024, 9:24:32 AMJan 26
to fastutil
I am new to this group , sorry if my conversation feels like I have no idea about the project .

 Ok , so I just found that C++ or to be more apt G++ has policy based data structures. 
Its ordered set Data Structure has two function , find_by_order and order_of_key. These functions help to get address of (x+1) th element or  to compute the number of elements smaller  than a given key in O(logN) time . I guess JCF has no such function. If I use headSet(key).size(). It takes O(N) time and for N queries it becomes N^2. So just a question does fastutil has some kind of Data structure like above implemented with these funcitons. 

You might say use segment tree to perform queries but there  I think if C++ users can have it then why not Java users?
If there are , I would love to use them and also I would want to know more about their implementation. 

Thank you in advance for your time and assistance. 
Reply all
Reply to author
Forward
0 new messages