mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-04 05:44:35 +00:00
[PR #927] Rewrite the trie example #1461
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/927
State: closed
Merged: Yes
The trie example had some issues;
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
any strlen/strnlen usage (inserts/searches could be sanitized by
snprintf)
a valid separator (say that you want a trie for certain binary
packages)
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.
a printf inside the algorithm), and uses double pointers for return
values (good practice)
scanf. The example is just an example after all, in real applications
you'd have better input sanitazion.
Description of Change
References
Checklist
Notes: