Time Left - 10:00 mins

ECIL GET 2018 : Topic wise test-1 (PDS)

Attempt now to get your rank among 682 students!

Question 1

What will be output if you will compile and execute the following c code ?
char c=125;
c=c+10;
printf(“%d”,c);

Question 2

What will be output if you will compile and execute the following c code ?
void main ()
printf(“%d”,sizeof(5.2));

Question 3

Which of the following is FALSE about abstract classes in JAVA?

Question 4

Bug means

Question 5

Which one of the following is a key factor for preferring B+-trees to binary search trees for indexing database relations?

Question 6

In a complete K-ary tree, every internal node has exactly k children. The number of leaves in such a tree with n internal nodes is

Question 7

A binary search tree is a binary tree:

Question 8

The post order traversal of a binary search tree is BDEFCA. Find out the pre-order traversal.

Question 9

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”
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?

Question 10

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”
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?
  • 682 attempts
  • 3 upvotes
  • 9 comments
Jul 9GATE & PSU CS