My Report

Data Structure II Practice Test 9


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Autokey cipher is an example of ___________

2. What will be the size of a key matrix if the plain text is “SECRET”?

3. What will be the ciphered text if the plain text “SAN” is encrypted using hill cipher with keyword as “GYBNQKURP”?

4. What is the output of the following code?

#include<stdio.h>
int get_ways(int num_of_dice, int num_of_faces, int S)
{
     int arr[num_of_dice + 1][S + 1];
     int dice, face, sm;
     for(dice = 0; dice <= num_of_dice; dice++)
         for(sm = 0; sm <= S; sm++)
           arr[dice][sm] = 0;
     for(sm = 1; sm <= S; sm++)
         arr[1][sm] = 1;
     for(dice = 2; dice <= num_of_dice; dice++)
     {
         for(sm = 1; sm <= S; sm++)
         {
             for(face = 1; face <= num_of_faces && face < sm; face++)
                 arr[dice][sm] += arr[dice - 1][sm - face];
         }
     }
     return arr[num_of_dice][S];
}
int main()
{
     int num_of_dice = 4, num_of_faces = 6, sum = 3;
     int ans = get_ways(num_of_dice, num_of_faces, sum);
     printf("%d",ans);
     return 0;
}

5. What will be the ciphered text corresponding to “SANFOUNDRY” if beaufort cipher is used for encryption with key as “KEY”?

6. In which of the following cipher the plain text and the ciphered text does not have same number of letters?

7. What will be the plain text corresponding to cipher text “SEDGKG” if beaufort cipher is used with key as “KEY”?

8. Which of the following cipher is a special case of affine cipher?

9. What will be the plain text corresponding to cipher text “ZEYQC” if autokey cipher is used with keyword as “SANFOUNDRY”?

10. Which of the following cipher uses polybius square cipher in its first step of encrypting data?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.