Please convert the code to C Language #include using namespace std; //comparing goodness of hash function 1 & 2 int main() { //set of input numbers vector arr{ 12345, 234245, XXXXXXXXXX, 765845,...


Please convert the code to
C Language



#include
using namespace std;


//comparing goodness of hash function 1 &  2
int main()
{


    //set of input numbers
    vector arr{ 12345, 234245, 1223123, 765845, 345234, 234534, 98675, 34523, 123, 3245 };


    //using hash function 1
    cout < "using="" hash="" function="">
    for (int a : arr) {
        cout < a="">< "-="">" < to_string(a).length()="" %="" 10=""><>
    }


    //using hash function 2
    cout < "\n\nusing="" hashh="" function="">
    for (int a : arr) {
        cout < a="">< "-="">" < (rand()="" *="" a)="" %="" 10=""><>
    }


    return 0;
}




Output:



using hash function 1<br>12345->5<br>234245->6<br>1223123->7<br>765845->6<br>345234->6<br>234534->6<br>98675->5<br>34523->5<br>123->3<br>3245->4<br>using hashh function 2<br>12345->9<br>234245->4<br>1223123->3<br>765845->-1<br>345234->-4<br>234534->4<br>98675->6<br>34523->0<br>123->5<br>3245->-9<br>

Extracted text: using hash function 1 12345->5 234245->6 1223123->7 765845->6 345234->6 234534->6 98675->5 34523->5 123->3 3245->4 using hashh function 2 12345->9 234245->4 1223123->3 765845->-1 345234->-4 234534->4 98675->6 34523->0 123->5 3245->-9

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here