## Saturday, 10 September 2016

### GATE Computer Science and Information Technology Solved Paper 2013 - Part 6

Common Data for Questions 50 and 51:
The procedure given below is required to find and replace certain characters inside an input character string supplied in array A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each. However, the procedure is flawed.
void find_and_replace(char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if( A[i]==oldc[j]) A[i]=newc[j];
}
The procedure is tested with the following four test cases
(1) oldc="abc", newc="dab"           (2) oldc="cde", newc="bcd"
(3) oldc="bca", newc="cda"            (4) oldc="abc", newc="bac"

50.       The tester now tests the program on all input strings of length five consisting of characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘e’ with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?
(A) Only one                 (B) Only two
(C) Only three             (D) All four
51.       If array A is made to hold the string “abcde”, which of the above four test cases will be successful in exposing the flaw in this procedure?
(A) None                       (B) 2 only
(C) 3 and 4 only           (D) 4 only

A computer uses 46–bit virtual address, 32–bit physical address, and a three–level paged page table organization. The page table base register stores the base address of the first–level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second–level table (T2). Each entry of T2 stores the base address of a page of the third–level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

52.       What is the size of a page in KB in this computer?
(A) 2                  (B) 4
(C) 8                  (D) 16
53.       What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
(A) 2                   (B) 4
(C) 8                   (D) 16
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
F={CH→G, A→BC, B→CFH, E→A, F→EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R
54.       How many candidate keys does the relation R have?
(A) 3                   (B) 4
(C) 5                  (D) 6
55.       The relation R is
(A) in INF, but not in 2NF       (B) in 2NF, but not in 3NF
(C) in 3NF, but not in BCNF (D) in BCNF