cznic / b Goto Github PK
View Code? Open in Web Editor NEWgithub.com/cznic/b has moved to modernc.org/b
Home Page: https://godoc.org/modernc.org/b
License: BSD 3-Clause "New" or "Revised" License
github.com/cznic/b has moved to modernc.org/b
Home Page: https://godoc.org/modernc.org/b
License: BSD 3-Clause "New" or "Revised" License
Based on the doc:
Seek returns an Enumerator positioned on an item such that k >= item's key.
However, here's a test that appears to be a special case with item's key > k:
func TestSeekBeforeFirst(t *testing.T) {
r := TreeNew(cmp)
r.Set(42, 314)
enum, ok := r.Seek(10)
if ok {
t.Fatal("WTF")
}
k, v, err := enum.Next()
t.Logf("K: %v, V: %v, Err: %v", k, v, err)
}
Output:
=== RUN TestSeekBeforeFirst
--- PASS: TestSeekBeforeFirst (0.00s)
all_test.go:181: K: 42, V: 314, Err: <nil>
Would be nice to update the doc about this behavior or even better have nil, nil, io.EOF
returned.
In order for this collection to provide an uniform api as part of the golang-collections project
i'm going to do the following.
Wrap Enumerator as a proper Nexter with a Next() method. This allows the user to walk the tree inorder.
implement Atter that stays near a certain key in the tree
Add an Atter .Fix() method that allows to synchronize the Atter after a collection insertions/deletions/rebalance.
Add method to MkNode() from an Atter. This allows O(1) insertion at any node in the structure
further things may be needed also but i'm really happy the enumerator is already implemented.
The fork is currently here:
https://github.com/golang-collections/b
Hi, just a note to say thank you. I have more deeply profiled this lib vs. github.com/google/btree
and found it superior. I have switched my more performance intensive use case already. I apologize for having to raise an issue to say this, however github.com has long ago disabled private messages. I also did not wish to continue the conversation on that repo, as it was becoming too unrelated to their library.
If i want to store btree in file and load/save it, how can i do that?
+ go test github.com/cznic/b
# github.com/cznic/b
(...)/src/github.com/cznic/b/all_test.go:321: Fatalf format %v reads arg #3, but call has only 2 args
(...)/src/github.com/cznic/b/all_test.go:356: Fatalf format %v reads arg #3, but call has only 2 args
FAIL github.com/cznic/b [build failed]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.