Question: Task: Use the cyclic shift hash (see CYCLIC in Program Examples) with: 1) no shift, 2) shift 3, 3) shift 5 on each of these

Task:

Use the cyclic shift hash (see "CYCLIC" in "Program Examples") with:

1) no shift,

2) shift 3,

3) shift 5

on each of these strings "abcde", "bacde", "abcdx" Please output the keys (numbers) grouped according to shift number and identify which string the key is paired with.

The program should be in C++.

-------------------------------------

"CYCLIC" Program example:

#include using namespace std; int main() { // n -bit cyclic shift n = 5 unsigned int h = 0; string A = "pots"; for(int i=0; i<4; i++) { h = (h << 5) | (h >> 27); // bitwise OR n left 32-n right h =h +(unsigned int) A[i]; } cout<> 27); // bitwise OR n left 32-n right h = h + (unsigned int)B[i]; } cout<                                            

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!