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.
A library of common data structures and algorithms written in C.
Added a flag to decide HashTableValue.
- Flag VALUE instructs hash_table_iter_next to return value.
- Flag KEY instructs hash_table_iter_next to return the key.
- Flag KEY_VALUE instructs hash_table_iter_next to return both key value pair.
KeyValue Pair is held in array where array is the key and array is the value.
It's not strictly required, but it's useful metadata, and part of the recommended license template text (see http://choosealicense.com/licenses/isc/ and https://opensource.org/licenses/isc-license)
The reason for this is to:
- Return both the Key and Value in composite
- Have function
KeyValuePairobject holding the composite of Key and Value without the extra call to lookup the value using
- Makes the interface cleaner.
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.
DFS -Depth First Search for graphs BFS - Breadth First Search for graphs BST - Binary Search Tree CheckingForBST - Check if a given Tree is a Binary Search Tree Tree - Implementation of tree.invalid
check the sanity of pointers as input parameters.
I am wondering whether it is necessary to add a callback function to free the ListValue when the entries are removed.
As addressed earlier also, the implementation of
rb_tree_subtree_heightfunction is missing in the file
rb_tree.cwhich 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?
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?
I preface that I'm quite new to C so this may be completely off. However, in:
0return 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 ?
c-algorithms-1.2.0(Apr 26, 2015)
- The license has been changed to the ISC license.
- Support for compiling with gcc coverage options and running tests in valgrind.
- All headers now have extern "C" definitions for use in C++ programs.
- Trie free function uses a non-recursive algorithm to avoid the possibility of stack overflow.
- Framework added for testing memory allocation/free.
- Tests have been fixed to properly free any memory allocated during execution of the test.
- Tests have been expanded to increase the code coverage.
- A test case has been added for testing use of the program in C++ programs.
- Memory leak in hash table.
- Bugs with the AVL tree.
- Trie responds to out of memory scenarios correctly.
c-algorithms-1.1.0(Apr 26, 2015)
- Added data structures:
- Binary Heap
- Binomial Heap
- Bloom Filter
- Iterator functions changed to a model based around an iterator structure rather than callback functions.
- Void pointers used for keys/values replaced by typedefs to void pointers. This allows the type to be changed to something else if desired.
- Hash table sizes changed to use a set of recommended prime numbers that are mathematically good for use in hash tables: http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
- Tests added for some code that was not covered by the test suite.
- Failed malloc() calls are now checked for.
- Bugs fixed:
- Lockup with set_remove function.
- set_to_array did not include all values.
- Added data structures: