B-trees using C - c

can any one provide me a link for B-tree code in C,have understood the algorithm but still have problems in coding it

c++
http://touc.org/btree.html
c (slightly fancier than normal)
http://code.google.com/p/high-concurrency-btree/downloads/list

Related

A more complete recursive descent c interpreter

I've seen several implementations of recursive descent c interpreters which all seem
to do a pretty good job - yet they all only implement a small portion of the C language -
for example they don't support structs or typedefs etc -
Does anyone know of any code that supports a large portion of the C language.
I know adding more functionality would be pretty trivial - but I'm a bit strapped
for time.
Picoc supports more that most of the Tiny/Small C interpreters. You might give it a look. And it does support structures.
If you just want to use it, this one looks awfully good for the job. There was a Dr. Dobb's article on it a while back ... there it is

How to write GMM (Gaussian Mixture Model) in C?

How can I write GMM (Gaussian Mixture Model) in C. There are some implementations in Matlab but I am looking for some documentation about it and example code in C not in C++.
OpenCV has an implementation of a GMM that is used for their GrabCut implementation.
You can find it for example here.
edit: I just noticed you were looking for an implementation in C. The OpenCV implementation is using C++. But maybe you can use it as a starting point.
Here you can find an implementation in C:
https://engineering.purdue.edu/~bouman/software/cluster/
How about the mixture model in Apophenia?
There is a GMM implementation available in vlfeat, a C library for computer vision. https://www.vlfeat.org/api/gmm.html

Do dictionaries exist in C?

In C, can you create a dictionary? I come from a Objective-C background so I would like to know if there is anything similar to NSDictionary.
You can create anything you want in C. You just won't have native language support for most of it.
You can create a dictionary in C, but there is no dictionary built in to the standard C library.
A quick search on Google code shows that there are open-source (and generously licensed) C dictionary implementations here and here.
Posix does have a limited hash table -- see hcreate(), hsearch() and hdestroy() that can be used by a C program.
A discussion of the limitations appears in this stackoverflow question.
Without OOP and templates, it would be hard to implement a hash table or a balanced tree that is truly general, easy to use and performant, and therefore worthy to be in the run-time library that comes with the language.
That being said, you can always implement your own, or just use C++ (see unordered_map or map).

HAT-trie in ANSI C implementation?

I am looking for ANSI C HAT-trie implementation released under some free license. I have not found one. Can you point me to some standalone implementation or a program that uses
HAT-tries to get at least slight idea how to implement it the roght way, please?
The original paper on HAT-trie can be found here:
http://crpit.com/confpapers/CRPITV62Askitis.pdf
PS: In case faster cache-conscious data structured well-suited for strings evolved since
the time the above paper was written, please point me to the papers or example source codes rather.
Someone is implementing it in C++ over on github
https://github.com/chris-vaszauskas/hat-trie
If you need a plain C implementation, this would be a good base to start from.
Java is also fairly readable for a C programmer
http://www.stochasticgeometry.ie/2008/05/06/implementing-hat-tries-in-java/
Please see the HAT-trie implementation site at code.google.com/p/hat-trie for implementation notes and source code.

hashtable implementation in C?

I was wondering if you knew of a robust implementation of a hashtable in C. I'm looking for something other than ghashtable in glib.
Thanks.
I've heard good things about the GLib Hash Table.
In C:
As previously mentioned g_hash_table in gLib:
http://library.gnome.org/devel/glib/stable/glib-Hash-Tables.html
uthash: https://github.com/troydhanson/uthash
khash in klib: https://github.com/attractivechaos/klib
cdada_map in libcdada: https://github.com/msune/libcdada (C API, backend C++)
If you can/want to use C++:
std::map in libstdc++ (look into std::unordered_map too)
As noted before (updated link) sparsehash: https://github.com/sparsehash/sparsehash (look into dense too)
Will this hashtable work? (got the link from the second post of this thread)
Perhaps this one will?
(got the above from a Google search for "hashtable in c", am not a C programmer)
For a hash table I'd use google-sparsehash
PD: I don't know your requirements, but take a look at HDF5, bear in mind it exists just in case.
update
Memory Structures Library (MemSL2), o MemSL2 in another link
it has implementations (one in pure C and wrappers for C++) of structures, for example, AVL trees, threaded trees, ..., and
Hash Tables with Separate Chaining,
Hash Tables with User-Defined Paging
Hash Tables with Dynamic Paging
A simple one in libc, see <hsearch.h> and man hsearch.
Update: just found that you can implement hashtable very easily with the help of hlist from Linux kernel. Take a look at <list.h> in Linux kernel source code for hlist_head/node and their operations.
You might want to look into using the Apache Portable Runtime? It's license is very liberal and it provides a decent hashtable implementation:
http://apr.apache.org/docs/apr/1.3/group__apr__hash.html

Resources