diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-05-28 10:55:38 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-05-28 10:55:38 -0400 |
commit | 9addd39acd0e53656ccedf4fb5380c8df7845a8f (patch) | |
tree | bd7e0a2e969523e7c7f07fc40b26931c58dbd30c /strbst.c | |
parent | d6e6291efe4281adb4d69071537f6f7010e71dfd (diff) |
made functions static
Diffstat (limited to 'strbst.c')
-rw-r--r-- | strbst.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -58,8 +58,10 @@ e b => a c *bst = (*bst)->right; // tip = b (*bst)->left->right = flip; } +// NOTE: These functions are valid because `b` is guaranteed in the +// conditions where the rotations are called. -int insnode(strbstnode** bst, strbstnode* new) { +static int insnode(strbstnode** bst, strbstnode* new) { // returns height of right node minus height of left node ("bias") if (!*bst) { // When an empty node is reached, *bst = new; // place the node @@ -96,7 +98,7 @@ void insbst(strbst* bst, char* ind, void* data) { insnode(&(bst->head), newbstnode(ind, data)); // allows recursion } -void* querynode(strbstnode* node, char* ind){ +static void* querynode(strbstnode* node, char* ind){ // tail-recursive finding algorithm if (!node) return NULL; // NULL => node not found int cmp = strcmp(ind, node->ind); |