The trie example had some issues;
* It did not follow the code convention in CONTRIBUTING.md
* The createTrieNode used an inefficient zeroing method (looping over
the entries) which also does not zero out holes in the structure (e.g.
an alternative would be to use "*node = &(TrieNode){0}", but calloc
does all that anyway
* It used an inefficient and clumsy printArray method
* It used strlen inside the algorithm; this new method could get rid of
any strlen/strnlen usage (inserts/searches could be sanitized by
snprintf)
* This version can allow for a custom mapping function, e.g. if NULL is
a valid separator (say that you want a trie for certain binary
packages)
* The previous version actually contained out-of-bounds array indexing;
there were no checks for out-of-bound indexing and words in the word
list did contain out of bounds words. It's a surprise it was working
so well.
* This version just returns 'int' to allow for error checks (instead of
a printf inside the algorithm), and uses double pointers for return
values (good practice)
* The usage example contained unnecessary mallocs, switched that out for
scanf. The example is just an example after all, in real applications
you'd have better input sanitazion.
Merge sort does not work properly. To reproduce the bug input 6, 5, 4, 3, 2, 1 the output would be 2, 3, 1, 4, 5, 6.
Co-authored-by: David Leal <halfpacho@gmail.com>
* perf: faster implementation of the TwoSum problem
* doc: fixed typos on comments
* updating DIRECTORY.md
* fix: comments on includes. Doxygen file. static test function
* fix: revert 1.c
* updating DIRECTORY.md
* fix: 0 files are not in one and only one directory
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* perf: faster implementation of the TwoSum problem
* doc: fixed typos on comments
* updating DIRECTORY.md
* fix: comments on includes. Doxygen file. static test function
* fix: #898 revert the nodir_files check version prior 2c86fbb
* fix: revert 1.c changes
* Apply suggestions from code review
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* perf: faster implementation of the TwoSum problem
* doc: fixed typos on comments
* updating DIRECTORY.md
* fix: comments on includes. Doxygen file. static test function
* fix: #898 awesome-workflow: 1 files are not in one and only one directory
* fix: revert 1.c changes
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Putting queue in correct dir and creating include file for it
* Update data_structures/queue/include.h
missing one function, added
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* Create sentinel_linear_search.c
This is a search algorithm that uses sentinels.
* Update sentinel_linear_search.c
Added some notes and made some changes
* updating DIRECTORY.md
* Apply suggestions from code review
thx u
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update sentinel_linear_search.c
* Apply suggestions from code review
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* added Conversion/decimal_to_anybase.c
* Added Converstions/decimal_to_any_base.c
* Enhencement of decimal_to_any_base.c
* Update conversions/decimal_to_any_base.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update conversions/decimal_to_any_base.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* updating DIRECTORY.md
* Update conversions/decimal_to_any_base.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update conversions/decimal_to_any_base.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* text enhencement and debugging
* comments norming
* builtin int types declacration changed into arch optimized int types
* comments norming
* Adding booleans and int types normalization
* Translation of the program into a function and tests added
* Commentary rewriting in decimal_to_anybase and code beautify
* added 1 comments in main and code beautify
* Commentary norming
* Code norming
* Apply suggestions from code review
Co-authored-by: Votre Nom <Vous@exemple.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* frequencies of words started
* A program to Print words contained in a file in alphabetical order
* Apply suggestions from code review
Co-authored-by: David Leal <halfpacho@gmail.com>
* appropriate comments added as suggested from code review
* comments cleaned up
* updating DIRECTORY.md
* Apply suggestions from code review
Co-authored-by: David Leal <halfpacho@gmail.com>
* commenting re-worded
* Add link to algorithm
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* main function moved to the bottom and function prototypes deleted
* uint64_t data type used for non negative values
* uint8_t used
* all int types fixed
* detailed explanation of algorithm added
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* tests and documentation added
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* documentation added
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update data_structures/binary_trees/words_alphabetical.c
Co-authored-by: David Leal <halfpacho@gmail.com>
* Apply suggestions from code review
Co-authored-by: David Leal <halfpacho@gmail.com>
* documentation added
* Apply suggestions from code review
Co-authored-by: David Leal <halfpacho@gmail.com>
* Add documentation
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>