0undefined / btree Goto Github PK
View Code? Open in Web Editor NEWC implementations of the B-Tree datastructure
License: ISC License
C implementations of the B-Tree datastructure
License: ISC License
In regards to #2, it should be considered to occasionally tidy up the nodes location in memory after some insertions/deletions.
Question is: should we have root node in the
of the memory block.
Create some benchmarks:
It would be nice to convert the project to use CMake instead of a plain ol' makefile.
This would make it integrate easier into other projects that also use CMake.
Write documentation!
Examples aren't enough.
Implementation details, such as the value inserted is copied, not the pointer to the variable, is very important to know when using this library.
See branch example-iter.
Failure with
btree-test: malloc.c:2539: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Happens when we need to allocate a new node, post-iteration.
Recursion shouldn't really be a problem, as the tree shouldn't be able to grow that tall.
It could be neat to compare performance of a recursion free implementation, possibly taking inspiration from the iteration implementation that uses a struct?
Make a single allocated memory block for the whole tree.
Pros:
Cons:
1
seems bothersome but easy, however 2
might be easier to implement with the current state of things. Also 2
is probably nicer to work with.
Write some tests to make sure shit don't break.
Couple of basic tests to implement:
Remove the memcpy spam in btree.c#L338.
It should be fine to simply do
i = n - 1;
while (i > 0 && cmp(elem, items+(i*size)) < 0) i--;
memmove(...);
memcpy(...);
...
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.