fragglet / c-algorithms Goto Github PK
View Code? Open in Web Editor NEWA library of common data structures and algorithms written in C.
Home Page: https://fragglet.github.io/c-algorithms/
License: ISC License
A library of common data structures and algorithms written in C.
Home Page: https://fragglet.github.io/c-algorithms/
License: ISC License
C Algorithms The C programming language includes a very limited standard library in comparison to other modern programming languages. This is a collection of common Computer Science algorithms which may be used in C projects. The code is licensed under the ISC license (a simplified version of the BSD license that is functionally identical). As such, it may legitimately be reused in any project, whether Proprietary or Open Source.
pkg-config file usually does not need to carry the version in the filename.
Hi there,
During wrapping this into a python libraty, I found rb_tree_subtree_height
missing in rb-tree.c
, which appears in the header file.
Did I miss something?
looking for c data structures and algorithms as my c tool kit, the recent release of c-algorithms is 8 years ago, is it actively maintained and 'production ready'? does it go through lots of test cases and field use, or at this point it's more of a reference implementation for others to learn how to do data structure and algorithms coding in C?
As addressed earlier also, the implementation of rb_tree_subtree_height
function is missing in the file rb_tree.c
which is specified there in the header file.
I have implemented and coded that function, so can you allow me to make a pull request for the same, so that you cam look at it, in order to resolve the issue?
Yes, I know I could examine all the headers available, but it'd be nice if each documentation page listed which header(s) you need to include to use it.
Current header files installation path is /usr/local/include/libcalg-1.0, which will generate an error when the user refers to libcalg.h
i want to use the lib in mcu( Inconvenient to use malloc and free), i find it only only can register "free function" useing your api.
Line 377 in 17cd712
This line should check the keys, not the values.
Separately, does this repro accept new features such as implementing the missing deletion functionality in rbtree?
Thanks!
I preface that I'm quite new to C so this may be completely off. However, in:
Lines 256 to 275 in 5b0555f
the 0
return value is used both for an operation that does not change the state of a set (because the value already exists), which may or may not be an issue, and a memory error, which is more likely to be an issue, and of a different type.
Shall the former not use a kind of custom error code, and the latter an ENOMEM according to https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html ?
Thanks.
At line 119 of https://github.com/fragglet/c-algorithms/blob/master/src/avl-tree.h, there is a function pointer for AVLTreeCompareFunc declared.
The declaration is:
typedef int (*AVLTreeCompareFunc)(AVLTreeValue value1, AVLTreeValue value2);
But the documentation (and code) shows that this function is for comparing the keys of two nodes in the tree, so the declaration should actually be:
typedef int (*AVLTreeCompareFunc)(AVLTreeKey key1, AVLTreeKey key2);
As both AVLTreeKey and AVLTreeValue are themselves typedefed as **void ***, it doesn’t actually make any difference to the function operation, but it makes the prototype confusing.
There are functions to get the value of a ListEntry, but there are no functions to write to the data of a ListEntry.
The underlying struct is defined in the list.c file so it is not possible to access it directly.
I am willing to implement the feature if needed.
Splint is a static code analysis tool, splint works with annotations. These annotations help you to do two things, it defines how functions behaves and which assumptions on input are made. Using splint memory leaks might be detected.
The only downside is that it is a lot of work to go through all code. But maybe it is possible to implement it data structure by data structure in a separate branch untill all structures are done.
On Mac how can I build the code, I found autogen.sh
can't run on Mac.
in file [src/rb-tree.c], function rb_tree_remove_node is empty
I tried.
./autogen.sh
make
Hi,
I am using the arraylist library in cython hobby project. So far so good. My project is a win32 api ui library. I have list box control . It has an items
property which is internally your arraylist. I need to implement an option to clear all the items from list box. It's okay, because I can call the arraylist_clear
function. But after clearing the arraylist, if my user wants to put another set of items what should I do ? Should I call arraylist_free
& arraylist_new
?
Thanks in advance.
This bug was reported previously but I don't think it was fixed.
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.