My Report

Data Structure II Mock 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
 10%

Question 1 of 10

1. What will be the plain text corresponding to cipher text “EETPEG” if gronsfeld cipher is used with key “4321”?

Question 1 of 10

Question 2 of 10

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

Question 2 of 10

Question 3 of 10

3. Which of the following ciphered text would have used transposition cipher for encryption of the plain text “SANFOUNDRY”?

Question 3 of 10

Question 4 of 10

4. What is the space complexity of the following dynamic programming implementation of the boolean parenthesization problem?

int count_bool_parenthesization(char *sym, char *op)
{
      int str_len = strlen(sym);
      int True[str_len][str_len],False[str_len][str_len];
      int row,col,length,l;
      for(row = 0, col = 0; row < str_len; row++,col++)
      {
          if(sym[row] == 'T')
          {
              True[row][col] = 1;
              False[row][col] = 0;
          }
          else
          {
              True[row][col] = 0;
              False[row][col] = 1;
          }
      }
      for(length = 1; length < str_len; length++)
      {
          for(row = 0, col = length; col < str_len; col++, row++)
          {
              True[row][col] = 0;
              False[row][col] = 0;
              for(l = 0; l < length; l++)
              {
                  int pos = row + l;
                  int t_row_pos = True[row][pos] + False[row][pos];
                  int t_pos_col = True[pos+1][col] + False[pos+1][col];
                  if(op[pos] == '|')
                  {
                      False[row][col] += False[row][pos] * False[pos+1][col];
                      True[row][col] += t_row_pos * t_pos_col - False[row][pos] * False[pos+1][col];;
                  }
                  if(op[pos] == '&')
                  {
                     True[row][col] += True[row][pos] * True[pos+1][col];
                     False[row][col] += t_row_pos * t_pos_col - True[row][pos] * True[pos+1][col];
                  }
                  if(op[pos] == '^')
                  {
                     True[row][col] += True[row][pos] * False[pos+1][col] 
                                       + False[row][pos] * True[pos + 1][col];
                     False[row][col] += True[row][pos] * True[pos+1][col] 
                                       + False[row][pos] * False[pos+1][col];
                  }
              }
          }
      }
      return True[0][str_len-1];
}

Question 4 of 10

Question 5 of 10

5. What is the meaning of cipher in cryptography?

Question 5 of 10

Question 6 of 10

6. Which of the following cipher is easiest to crack?

Question 6 of 10

Question 7 of 10

7. Trithemius cipher is harder to crack than caesar cipher.

Question 7 of 10

Question 8 of 10

8. Which of the following is not a type of transposition cipher?

Question 8 of 10

Question 9 of 10

9. Which of the following cipher does not require the use of tabula recta?

Question 9 of 10

Question 10 of 10

10. What is the maximum number of ways in which a boolean expression with n + 1 terms can be parenthesized, such that the output is true?

Question 10 of 10


 

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.