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:
#includeusing 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
Get step-by-step solutions from verified subject matter experts
