Monday, 5 February 2018

HSST Computer Science Junior Solved Paper 016/2018 - Part 1

Question Paper Code: 016/2018
Category Code: 341/2017
Exam: HSST Computer Science Junior
Date of Test: 01-02-2018
Alpha code: A
Provisional key

1.       #define AND &&
#define OR !!
#define LE <=
#define GE >=
main()
{
char ch=‘D’:
if ((ch GE 65 AND ch LE 90) OR (ch GE 97 AND ch LE 122))
printf(“alphabet”);
else
printf(“not an alphabets”):
}
(A) Compilation error
(B) Not an alphabet
(C) Alphabet
(D) None of the above
Answer: C
2.       main()
{
static char * s[] = {“ice”, “green”, “core”, “please”}:
static char **ptr[] = {s+3, s+2, s+1,s}:
char ***p=ptr;
printf(“%s\n”, **++p);
printf(“%s\n”, *--*++p+3);
printf(“%s\n”, *p[–2]+3);
printf(“%s\n”,p[–1][–1]+1);
}
(A) ice
plea
gr
(B) core
ase
reen
(C) please
core
gr
(D) None
Answer: B
3.       main()
{
int k=35,z;
K=func1(k=func1(k=func1(k)));
printf(“k=%d”,k);
}
Funct1(k)
int k:
{
K++;
return(k):
}
(A) 35
(B) 37
(C) 38
(D) 40
Answer: C
4.       main ()
{
int j=1;
while (j<=255);
printf(“%c%d\n”, j,j);
j++;
}
}
(A) 255
(B) 255, 255
(C) No output
(D) 256
Answer: C
5.       main()
{
int a=500, b=100,c;
if (!a>=400)
b=300;
c=200;
printf(“b=%d c=%d”,b,c);
}
(A) b=100, c=400
(B) b=100, c=300
(C) b=100, c=200
(D) None of the above
Answer: C
6.       Multiple inheritance in java can be achieved by:
(A) interface
(B) polymorphism
(C) abstraction
(D) encapsulation
Answer: A
7.       Which is the base class of all classes in java?
(A) system.lang
(B) class.object
(C) java.lang.object
(D) none of the above
Answer: C
8.       class output
{
public static void main (string args[ ])
{ string Buffer sb=new string Buffer (“Hello”);
Sb.delete (0,2);
system.out.println(c);
}
(A) He
(B) Hel
(C) lo
(D) llo
Answer: D
9.       Which of the interface contain all the method used for handling thread related operations in java?
(A) Runnable interface
(B) Math interface
(C) System interface
(D) Thread handling interface
Answer: D
10.    Which of the package contains abstract keyword?
(A) java.lang
(B) java.util
(C) java.io
(D) java.system
Answer: A

11.    A member function which initializes data member of an object in:
(A) Destructor
(B) Constructor
(C) Inline function
(D) Friend function
Answer: B
12.    A C++ key word, which, when used inside a member function of a class, represents a pointer to the particular class object that invoked it:
(A) *
(B) this
(C) →
(D) None
Answer: B
13.    Which of the following is a non linear data structure?
(A) Tree
(B) Array
(C) Linked list
(D) None of the above
Answer: A
14.    Which of the following is NOT a method for performing amortized analysis of algorithms?
(A) Aggregate method
(B) Accounting method
(C) Potential method
(D) None of the above
Answer: D
15.    0-1 Knapsack problem can be solved by:
(A) Greedy method
(B) Dynamic programming method
(C) Divide and conquer method
(D) None of the above
Answer: B
16.    Which is NOT a collision resolution technique in Hashing?
(A) Chaining
(B) Linear probing
(C) Quadratic Probing
(D) None of the above
Answer: D
17.    If any NP complete problem is in P class, then:
(A) P=NP
(B) P!=NP
(C) P≤NP
(D) None of the above
Answer: A
18.    Which of the following problem is NOT NP-complete?
(A) Hamiltonian cycle problem
(B) Clique problem
(C) Travelling−salesman problem
(D) None of the above
Answer: D
19.    The running time of Kruska’ls algorithm for a graph G=(V, E) for finding
Minimum–spanning–tree is:
(A) O(E log2 V)
(B) O(E+V log2 V)
(C) O(E2)
(D) O(V2)
Answer: A
20.    The data structure used in breadth–first–search (BST) is:
(A) Stack
(B) Queue
(C) B–Tree
(D) None of the above
Answer: B

Pages   2   3   4   5 

0 comments:

Post a Comment