Giter Club home page Giter Club logo

b's People

Contributors

bfallik avatar cznic avatar kortschak avatar myitcv avatar navytux avatar nikandfor avatar timoha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b's Issues

Seek(k) returns the first item of the tree even if item's key is larger than k

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.

Rename Enumerator to Nexter, implement Atter that stays near a certain key in the tree

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

A quick thank you

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.

fails to build with go 1.10 prerelease

+ 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]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.