string-hash.c
void __insert_StrHash(StrHash_NODE *arr, char *str, unsigned long int index, unsigned long int cap, int v1, int v2, int congestion, int length)
{
    unsigned long int i = 1;
    unsigned long int base = index;
    while (1)
    {
        if (!arr[index].visited)
        {
            strcpy(arr[index].str, str);
            arr[index].v1 = v1;
            arr[index].v2 = v2;
            arr[index].congestion = congestion;
            arr[index].length = length;
            arr[index].visited = true;
            break;
        }
        else
        {
            index = base + i * i;
            index = index % cap;
            i++;
        }
    }
}
//Inserting into the Hash Table (to be used inside Insert_StrHash).
Inserting into the Hash Table (to be used inside Insert_StrHash).
Inserting into the Hash Table ( to be used inside Insert_StrHash ) .
void __insert_StrHash(StrHash_NODE *arr, char *str, unsigned long int index, unsigned long int cap, int v1, int v2, int congestion, int length)
{
    unsigned long int i = 1;
    unsigned long int base = index;
    while (1)
    {
        if (!arr[index].visited)
        {
            strcpy(arr[index].str, str);
            arr[index].v1 = v1;
            arr[index].v2 = v2;
            arr[index].congestion = congestion;
            arr[index].length = length;
            arr[index].visited = true;
            break;
        }
        else
        {
            index = base + i * i;
            index = index % cap;
            i++;
        }
    }
}
void __insert_StrHash ( StrHash_NODE * arr , char * str , unsigned long int index , unsigned long int cap , int v1 , int v2 , int congestion , int length ) { unsigned long int i = 1 ; unsigned long int base = index ; while ( 1 ) { if ( ! arr [ index ] . visited ) { strcpy ( arr [ index ] . str , str ) ; arr [ index ] . v1 = v1 ; arr [ index ] . v2 = v2 ; arr [ index ] . congestion = congestion ; arr [ index ] . length = length ; arr [ index ] . visited = true ; break ; } else { index = base + i * i ; index = index % cap ; i ++ ; } } }
Inserting into the Hash Table (to be used inside Insert_StrHash).
Inserting into the Hash Table ( to be used inside Insert_StrHash ) .