string-hash.c
void Rehash_StrHash(StrHash table, unsigned long int new_size) {
    unsigned long int old_cap = table->cap;

    StrHash_NODE *new_arr;
    new_arr = (StrHash_NODE *)malloc(sizeof(StrHash_NODE) * new_size);

    for (unsigned long int i = 0; i < old_cap; i++)
    {
        if (!table->bkt_arr[i].visited)
        {
            continue;
        }
        else
        {
            unsigned long int place = Str_Hash(table->bkt_arr[i].str, new_size);
            __insert_StrHash(new_arr, table->bkt_arr[i].str, place, new_size, table->bkt_arr[i].v1, table->bkt_arr[i].v2, table->bkt_arr[i].congestion, table->bkt_arr[i].length);
        }
    }

    table->cap = new_size;
    table->bkt_arr = new_arr;
}
//Rehashing in case of collision in the the Hash Table.
Rehashing in case of collision in the the Hash Table.
Rehashing in case of collision in the the Hash Table .
void Rehash_StrHash(StrHash table, unsigned long int new_size) {
    unsigned long int old_cap = table->cap;
    StrHash_NODE *new_arr;
    new_arr = (StrHash_NODE *)malloc(sizeof(StrHash_NODE) * new_size);
    for (unsigned long int i = 0; i < old_cap; i++)
    {
        if (!table->bkt_arr[i].visited)
        {
            continue;
        }
        else
        {
            unsigned long int place = Str_Hash(table->bkt_arr[i].str, new_size);
            __insert_StrHash(new_arr, table->bkt_arr[i].str, place, new_size, table->bkt_arr[i].v1, table->bkt_arr[i].v2, table->bkt_arr[i].congestion, table->bkt_arr[i].length);
        }
    }
    table->cap = new_size;
    table->bkt_arr = new_arr;
}
void Rehash_StrHash ( StrHash table , unsigned long int new_size ) { unsigned long int old_cap = table -> cap ; StrHash_NODE * new_arr ; new_arr = ( StrHash_NODE * ) malloc ( sizeof ( StrHash_NODE ) * new_size ) ; for ( unsigned long int i = 0 ; i < old_cap ; i ++ ) { if ( ! table -> bkt_arr [ i ] . visited ) { continue ; } else { unsigned long int place = Str_Hash ( table -> bkt_arr [ i ] . str , new_size ) ; __insert_StrHash ( new_arr , table -> bkt_arr [ i ] . str , place , new_size , table -> bkt_arr [ i ] . v1 , table -> bkt_arr [ i ] . v2 , table -> bkt_arr [ i ] . congestion , table -> bkt_arr [ i ] . length ) ; } } table -> cap = new_size ; table -> bkt_arr = new_arr ; }
Rehashing in case of collision in the the Hash Table.
Rehashing in case of collision in the the Hash Table .