Closed darfire closed 4 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!
) and we'll verify. Thanks.
Signed
On Sun, Oct 16, 2016 at 10:30 PM, googlebot notifications@github.com wrote:
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll
verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data https://cla.developers.google.com/clas and verify that your email is set on your git commits https://help.github.com/articles/setting-your-email-in-git/.
- If you signed the CLA as a corporation, please let us know the company's name.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/btree/pull/15#issuecomment-254068518, or mute the thread https://github.com/notifications/unsubscribe-auth/ADG9vzSLnOK3ePwJ3m4kqU0lPf1YL8t5ks5q0ns7gaJpZM4KYDrF .
CLAs look good, thanks!
Interesting, what's the use case for this?
My use case was that I needed to draw a random item from my btree, which I was using as a set. With this is just GetAt(randInt(t.Len()))
Having this, we can also implement other operations like split/join on btrees, if needed.
On Mon, Oct 17, 2016 at 6:38 PM, Graeme Connell notifications@github.com wrote:
Interesting, what's the use case for this?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/btree/pull/15#issuecomment-254244661, or mute the thread https://github.com/notifications/unsubscribe-auth/ADG9v5XVXjRoVpOrR1Ek2epfJNQKTOzcks5q05aKgaJpZM4KYDrF .
Added a method that returns the ith item in the btree. In order to do this, each node has an idea of the number of items in the tree of which it is the root. I've updated all relevant insert/delete functions to maintain each node's length. The performance is unchanged.
Looking forward to suggestions that can improve this feature. Cheers.