Fast*er* string comparison
Go to file
2024-08-25 22:24:08 +02:00
.gitignore feat: implement funky tree lookup 2024-08-25 14:04:27 +02:00
data.c feat: implement funky tree lookup 2024-08-25 14:04:27 +02:00
Makefile feat: implement funky tree lookup 2024-08-25 14:04:27 +02:00
README feat: use char hashmap for child search 2024-08-25 22:24:08 +02:00
streecmp.c feat: use char hashmap for child search 2024-08-25 22:24:08 +02:00
streecmp.h feat: use char hashmap for child search 2024-08-25 22:24:08 +02:00
test.c feat: use char hashmap for child search 2024-08-25 22:24:08 +02:00

+==============+
|   streecmp   |
+==============+

    Fast*er* string comparison - an alternative to thousands of strcmp calls

    RES: en.wikipedia.org/wiki/Trie
    RES: en.wikipedia.org/wiki/Suffix_tree
    RES: en.wikipedia.org/wiki/Radix_tree
    RES: facweb.cs.depaul.edu/mobasher/classes/csc575/Suffix_Trees/index.html

TECHNICALS

    struct nod 
        * data structure that represents a node of the tree
    struct nod *mknod(struct nod *prnt)
        * create a child node below given parent node 
        * returns: pointer to said node or NULL if fails
    int mkstr(struct nod *rot, char *str)
        * fit string into tree if it does not already exist
        * warning: string has to be null-byte terminated 
        * returns: the assigned ID of the string or -1 if fails
    int gentree(struct nod *rot, char *strs)
        * generate tree from character seperated strings
        * warning: seperation character is '\n'
        * returns: 0 if ok or -1 if fails
    int streecmp(struct nod *rot, char *str) 
        * traverse tree and search for str
        * returns: id of string or 0 if there is no match

TODO

    * Detect strings which are already inside the tree
    * Memory leaks
    * Alloc/free functions
    * NULL checking
    * Memset for initialization
    * gentree with custom seperator

COMMITS
    
    Each commit is prefixed with an indicator token of what the change is
    *mostly* about. List of tokens is: 
    
        * repo: change docs or code style
        * feat: implement new change
        * fix: implement fix for a bug