Common data 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
Answer: b
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
Answer: c
Linked answer questions
Statement for linked answer questions 52 and
53
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
Answer: wait...
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
Answer: wait...
Statement for linked answer questions 54 and 55
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
Answer: b
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
Answer: a
Next: Computer science and Information Technology GATE 2013 answer key questions 56-65
Previous: Computer science and Information Technology GATE 2013 answer key questions 47-49
No comments:
Post a Comment