65#define COUNT_OF_LETTERS_IN_DOMAIN 256
66#define MAX_SIZE_OF_DOMAIN 256
67#define MAX_SIZE_OF_DEGREE 5
68#define ADD_TO_LIST_FROM_COUNT_OF_SEARCH 20
69#define ADD_TO_LIST_FROM_COUNT_OF_DIFFERENT_SUBDOMAINS 10
70#define MAX_COUNT_TO_BE_IN_JUST_ONE_SEARCHER 10
prefix_tree_inner_node_t * prefix_tree_most_substring(prefix_tree_inner_node_t *node)
Returns inner node with most of different strings Function returns pointer to inner node,...
prefix_tree_inner_node_t * join_nodes(prefix_tree_inner_node_t *node)
Function joins two nodes into one. If parent has just one child, this function join them into one nod...
int prefix_tree_count_to_domain_separator(const char *string, int length, int domain_separator, char prefix)
Count length of string to dot Function counts length of string to dot.
prefix_tree_domain_t * prefix_tree_add_domain_recursive_suffix(prefix_tree_inner_node_t *node, prefix_tree_domain_t *domain_parent, const char *string, int length, prefix_tree_t *tree)
Add domain recursive (suffix tree) Function adds domain to the prefix tree. This function is called f...
prefix_tree_t * prefix_tree_initialize(unsigned char prefix_suffix, unsigned int size_of_value, int domain_separator, int domain_extension, relaxation_after_delete relaxation)
Init function for prefix tree Function that incialize prefix tree.
prefix_tree_domain_t * prefix_tree_add_domain_recursive_prefix(prefix_tree_inner_node_t *node, prefix_tree_domain_t *domain_parent, const char *string, int length, prefix_tree_t *tree)
Add domain recursive (prefix tree) Function adds domain to the prefix tree. This function is called f...
prefix_tree_domain_t * prefix_tree_insert(prefix_tree_t *tree, const char *string, int length)
Add domain to prefix tree Function adds domain to the prefix tree.
prefix_tree_inner_node_t * prefix_tree_new_node_parent_is_domain(prefix_tree_domain_t *domain)
Create descendant of domain Function creates descendant of domain, (domain has other subdomains).
prefix_tree_inner_node_t * prefix_tree_add_children_array(prefix_tree_inner_node_t *parent)
Alloc memory for descendats in inner node Function allocs memory for descendats in inner node.
double prefix_tree_most_used_domain_percent_of_subdomains(prefix_tree_t *tree, int depth)
Statistic function percent od subdomains in certain depth Function returns percent of subdomains in m...
int prefix_tree_destroy_recursive(prefix_tree_t *tree, prefix_tree_inner_node_t *node)
Destroy all items in prefix tree Function destroy recursively destroies all nodes.
char * prefix_tree_read_string(prefix_tree_t *tree, prefix_tree_domain_t *domain, char *string)
Read domain from tree Function return string with the domain name.
void prefix_tree_destroy(prefix_tree_t *tree)
Destroy function for prefix tree Function destroy prefix tree and all item inside.
prefix_tree_domain_t * prefix_tree_new_domain(prefix_tree_inner_node_t *node, prefix_tree_domain_t *domain_parent, prefix_tree_t *tree)
Create domain node structure Function Create domian and connects it to the tree.
prefix_tree_domain_t * prefix_tree_search(prefix_tree_t *tree, const char *string, int length)
Seacrh domain in prefix tree Function adds domain to the prefix tree.
void prefix_tree_decrease_counters_deleted_inner_node(prefix_tree_inner_node_t *node, int deleted_strings, int deleted_domains)
Decrease counters in prefix tree, if deleting a node. Function that goes from the node to the root an...
prefix_tree_domain_t * prefix_tree_add_new_item(prefix_tree_inner_node_t *node, prefix_tree_domain_t *domain, const char *string, int length, prefix_tree_t *tree)
Add new item to prefix tree Function add new item to prefix tree (place where to add new domain has t...
prefix_tree_inner_node_t * prefix_tree_new_node(prefix_tree_inner_node_t *parent, int map_number)
Create inner node structure Function Create inned node and connects it to the tree.
void prefix_tree_recursive_plus_domain(prefix_tree_domain_t *domain_parent, prefix_tree_t *tree)
Recursive change info about parent doimains Function actualize information in parent domains.
prefix_tree_inner_node_t * prefix_tree_split_node_into_two(prefix_tree_inner_node_t *node, int index)
Split node into two nodes Function splits node into two nodes, on the given position....
prefix_tree_domain_t * prefix_tree_add_string_exception(prefix_tree_t *tree, const char *string, int length)
Add domain to prefix tree and set it to the exception state Function adds domain to the prefix tree a...
@ RELAXATION_AFTER_DELETE_NO
@ RELAXATION_AFTER_DELETE_YES
int prefix_tree_is_string_in_exception(prefix_tree_t *tree, const char *string, int length)
Test domain if is in exception state Function tests domain if is in exception state.
char * prefix_tree_read_inner_node(prefix_tree_t *tree, prefix_tree_inner_node_t *node, char *string)
Read string from inner node Function return string stored in given inner node.
int prefix_tree_map_character_to_number(unsigned char letter)
Map character to index Function maps character to index in descendants.
void prefix_tree_delete_inner_node(prefix_tree_t *tree, prefix_tree_inner_node_t *node)
Function which removes inner node and his descendats. Function will erase specified node and all his ...
Structure - domain extension Structure keeps pointers in linked list to other domain nodes.
prefix_tree_domain_t * most_used_domain_more
prefix_tree_domain_t * most_subdomains_more
prefix_tree_domain_t * most_subdomains_less
prefix_tree_domain_t * most_used_domain_less
Structure - Prefix tree - domain name structure Structure used to keep information about domain names...
prefix_tree_inner_node_t * child
prefix_tree_inner_node_t * parent
node_domain_extension_t * domain_extension
unsigned int count_of_different_subdomains
prefix_tree_domain_t * parent_domain
unsigned int count_of_insert
Structure - Prefix tree - inner node structure Structure used to keep information about inner node of...
prefix_tree_domain_t * domain
prefix_tree_domain_t * parent_is_domain
unsigned char count_of_children
prefix_tree_inner_node_t ** child
prefix_tree_inner_node_t * parent
unsigned int count_of_string
Structure - Prefix tree main structure Structure used to keep information about prefix tree....
unsigned int count_of_domain_searched_just_ones
tree_domain_extension_t * domain_extension
unsigned int size_of_value
prefix_tree_inner_node_t * root
unsigned int count_of_different_domains
unsigned int count_of_inserting
unsigned char prefix_suffix
relaxation_after_delete relaxation
unsigned int count_of_inserting_for_just_ones
Structure - Domain names extension Structure used to keep lists of most searched domains,...
prefix_tree_domain_t ** list_of_most_subdomains_end
prefix_tree_domain_t * list_of_most_used_domains_end
prefix_tree_domain_t * list_of_most_used_domains
prefix_tree_domain_t ** list_of_most_subdomains
prefix_tree_domain_t * list_of_most_unused_domains