Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 45

Sr No

Question

Option A

An algorithm is made up of 2 modules Ml and M2. If


order of M1 is f(n) and M2 is g(n) then the order of the max (f (n) ,g
algorithm is
(n))
There are 4 different algorithms AI, A2, A3, A4 to solve
a given problem with the order Iog(n), log(log(n)),
nIog(n) ,n / log(n) respectively. Which is the best
algorithm?
A1

whether correct ?
100

The time required to search an element in a linked list


of length n is
. O(log2 n)
Consider the following two functions.
f(n) = n3, if 0n < 10,000
n2, otherwise
f(n) is O(n3)

What is the worst-case time for serial search finding a


single item in an array?
If there exists two functions f(n)and g(n) The constant
c>0 and there exists an integer constant n0>=1 If f(n)
If there exists two functions f(n)and g(n) The constant
c>0 and there exists an integer constant n0>=1 If f(n)
Choose the correct complexity for following code
while(n>0)<BR>{<BR>n=n/10<BR>}

(n-1)*(n-5) is expressed in terms of big oh

3
4
5
6
7

Constant time
f(n)= O(g(n))

100

f(n)= O(g(n))

O(1)

O(1)

31

32

33

34

35

36
37

0
0

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

r correct ?

Option B

whether correct ?

min (f (n) ,g (n) 0


)

Option C whether correct ?


0
f (n) + g (n)

100
A2
O(n)
. g(n) is O(n2

0
A3

100
0

O(1)
O(f(n)) is
same as
O(g(n))

0
0

Logarithmic
time

f(n)=(g(n))

f (n) =(g(n)) 0

f(n)=(g(n))

f (n) =(g(n)) 100

O(n)

O(logn)

100

O(n)

O(logn)

100

100
Linear time

0
0

0
0

Option D

whether correct
0

.f (n) x g (n )

0
A4
O(n^2)
Both(b) and

0
100
0

Quadratic time
f(n)= o(g(n))

f(n)= o(g(n))

O(n2)

O(n2)

100
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

marks

Unit

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0

Sr No

Question

3
4
5
6
7
8
9
10
11
12

whether correct ?

it can be used
to decide the
best algorithm 0
that solves a

Option A

concept
of orderof
(Big
is important
The time
complexity
anO)
algorithm
T(n), because
where n is
the input size, is given by
100
T( n) = T( n - 1) + 1/n if n > 1
logn
In the worst case, the number of comparisons needed
0
to search a single linked list of length n for a given
logn
A mathematical-model with a collection of operations
defined on that model is called
Data Structure 0
Data structure in which one predecessor may have one
or more successor.
Time factor while determining the efficiency of
algorithm is measured by
Which of the following is not the part of ADT
description?
Which data structure is best suited to print the
documents in the printer
What term is used to describe an O(n) algorithm.
Time required to check to determine whether a given
no is prime

0
Linear

0
Counting Microseconds
data

. Stacks

Constan

quadratic
counting the
maximum

The space factor is measured by---The practice ---- is used to define tight lower bound on
growth of function f(n)
big oh

100
0

31

32

33

34

35

36
37

0
0

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

r correct ?

Option B

whether correct ?

it determines
the maximum
100
size of a
problem that
n
n/2

0
0

100
Abstract Data Type

Option C whether correct ?


0
Both a & b
n2
log(n/2)-1
primitive
data type

0
0
0

100

primitive
Counting no of
0
statements

Non-linear
Counting no
100
of key

operations

Queues

100

Both a & b 100


both stack &
0
queue

linear

100

logarithmic

linear
counting the
minimum

100
0

logarithmic 0
counting the
0
aveage

big omega

100

big theta

0
0

0
0

Option D

whether correct

marks

Unit

0
None of the above
nn

100

algorithm

None of the
above

0
Counting key algorithm
None of the
0
above
Arrays

quadratic

constant time 0
counting the
maximum disk 0
none of these

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0

Sr No
1

2
3
4
5
6
7
8
9

Question

Option A

Which of the following symbols is used to denote a pre!


processor statement?
it can be used
to decide the
best algorithm
The concept of order (Big O) is important because
that solves a
The time complexity of an algorithm T(n), where n is
the input size, is given by
logn
The order of an algorithm that finds whether a given
Boolean function of 'n' variables, produces a 1 is
constant
In the worst case, the number of comparisons needed
to search a single linked list of length n for a given
logn
A mathematical-model with a collection of operations
defined on that model is called
Data Structure
The term data structure refers to -----------and
Programming
interelationship beween them
language
Static data
Array is an example of
structure

whether correct ?
0

0
100
100
0
0
0
0
100

12

Two main measures for the efficiency of algorithm are Time and space
Much more
The complexity of the average case of an algorithm is complicated to
Data which can't be divided further into meaningful
pieces is
Atomic data
Which of the following is not the part of ADT
description?
data

13

. is not the component of data structure.

operations

14

What term is used to describe an O(n) algorithm.

Constan

10
11

100
100
0

31

32

33

34

35

36
37

0
0

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

r correct ?

Option B

whether correct ?

Option C whether correct ?

100

it determines
the maximum
100
size of a
problem that

0
Both a & b

n2

linear

logarithmic

n/2

100
Abstract Data Type
Coding
0
Standards.

0
log(n/2)-1
primitive
0
data type
Organization
100
of data

0
Dynamic Data Structure.

0
Linear data structure.

0
Processor and memory

0
Data and Space.
Sometimes
0 to analyze than that of worst case
0
more
Much more simpler
Composite
0
Primitive data 0
data
operations
storage
structures

Both a & b

100

algorithms

linear

100

logarithmic

0
0

0
0

Option D
;

whether correct
0

marks

Unit

0
None of the above
nn

exponential

100

algorithm

None of this

100
both a & c
Complexity and
0
capacity
None or above
None of the
above
None of the
above
none of the
above

quadratic

0
0
100

0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0

You might also like