0% found this document useful (0 votes)
63 views466 pages

Combined CD Ac Papers

The document contains questions and explanations about various data structures and algorithms topics like sorting algorithms, search algorithms, time complexity analysis etc. Some key points: - Linear search has worst case time complexity of O(n) when the item is searched at the end of the array. Average case is when item is in middle. - Selection sort can be efficient for small number of records as its time complexity is O(n^2). - Sorting algorithm complexity measures the running time as a function of number of items n. - Binary search has limitations like the array must be sorted but does not have a limitation on number of elements. - Quicksort typically has time complexity of O(n

Uploaded by

NN S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views466 pages

Combined CD Ac Papers

The document contains questions and explanations about various data structures and algorithms topics like sorting algorithms, search algorithms, time complexity analysis etc. Some key points: - Linear search has worst case time complexity of O(n) when the item is searched at the end of the array. Average case is when item is in middle. - Selection sort can be efficient for small number of records as its time complexity is O(n^2). - Sorting algorithm complexity measures the running time as a function of number of items n. - Binary search has limitations like the array must be sorted but does not have a limitation on number of elements. - Quicksort typically has time complexity of O(n

Uploaded by

NN S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 466

----------------------------------data structure

mcqz----------------------------------------------------------------

1) The worst case occur in linear search algorithm when …


ans:Item is the last element in the array

explaination:
-------------
1.The average case occurs in the Linear Search Algorithm when the item to be
searched is in some where middle of the Array.
2.The best case occurs in the Linear Search Algorithm when the item to be
searched is in starting of the Array.
3.The worst case occurs in the Linear Search Algorithm when the item to be
searched is in end of the Array.

2) If the number of records to be sorted is small, then …… sorting can be


efficient.

A. Merge
B. Heap
C. Selection
D. Bubble
Ans : C

3) The complexity of sorting algorithm measures the …… as a function of the


number n of items
to be sorter.
A. average time
B. running time
C. average-case complexity
D. case-complexity
ans: B

4) Which of the following is not a limitation of binary search algorithm?


A. must use a sorted array
B. requirement of sorted array is expensive when a lot of insertion and
deletions are needed
C. there must be a mechanism to access middle element directly
D. binary search algorithm is not efficient when the data elements more than
1500.
ans:D

5) The Average case occurs in linear search algorithm ……….


A. when item is somewhere in the middle of the array
B. when item is not the array at all
C. when item is the last element in the array
D. Item is the last element in the array or item is not there at all
ANS:A

6) Binary search algorithm cannot be applied to …


A. sorted linked list
B. sorted binary trees
C. sorted linear array
D. pointer array

ANS:A

7) Complexity of linear search algorithm is ………


A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
ANS:A
8) Sorting algorithm can be characterized as ……
A. Simple algorithm which require the order of n2 comparisons to sort n items.
B. Sophisticated algorithms that require the O(nlog2n) comparisons to sort
items.
C. Both of the above
D. None of the above
ANS:C

9) The complexity of bubble sort algorithm is …..


A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
ANS:C

10) State True or False for internal sorting algorithms.


i) Internal sorting are applied when the entire collection if data to be sorted
is small enough that the sorting can take place within main memory.
ii) The time required to read or write is considered to be significant in
evaluating the performance of internal sorting.
A. i-True, ii-True
B. i-True, ii-False
C. i-False, ii-True
D. i-False, ii-False
ANS:B

11) The complexity of merge sort algorithm is ……


A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
ANS:D

12) ………. is putting an element in the appropriate place in a sorted list yields
a larger sorted order list.
A. Insertion
B. Extraction
C. Selection
D. Distribution
ANS:A

13) …………order is the best possible for array sorting algorithm which sorts n
item.
A. O(n logn)
B. O(n2)
C. O(n+logn)
D. O(logn)
ANS:C

14) ……… is rearranging pairs of elements which are out of order, until no such
pairs remain.
A. Insertion
B. Exchange
C. Selection
D. Distribution
ANS:B

15) ………… is the method used by card sorter.


A. Radix sort
B. Insertion
C. Heap
D. Quick
ANS:A
16) Which of the following sorting algorithm is of divide and conquer type?
A. Bubble sort
B. Insertion sort
C. Merge sort
D. Selection sort
ANS:C

17) …….. sorting algorithm is frequently used when n is small where n is total
number of elements.
A. Heap
B. Insertion
C. Bubble
D. Quick
ANS:B

18) Which of the following sorting algorithm is of priority queue sorting type?
A. Bubble sort
B. Insertion sort
C. Merge sort
D. Selection sort
AND:D

19) Which of the following is not the required condition for binary search
algorithm?
A. The list must be sorted
B. There should be the direct access to the middle element in any sub list
C. There must be mechanism to delete and/or insert elements in list.
D. Number values should only be present
ANS:C

20) Partition and exchange sort is ……..


A. quick sort
B. tree sort
C. heap sort
D. bubble sort
ANS:A

21. What is recurrence for worst case of QuickSort and what is the time
complexity in Worst case?

A. Recurrence is T(n) = T(n-2) + O(n) and time complexity is O(n^2)


B. Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)
C. Recurrence is T(n) = 2T(n/2) + O(n) and time complexity is O(nLogn)
D. Recurrence is T(n) = T(n/10) + T(9n/10) + O(n) and time complexity is
O(nLogn)
View Answer

Ans : B
Explanation: No explanation.

22. Which of the following is not a stable sorting algorithm?

A. Insertion sort
B. Selection sort
C. Bubble sort
D. Merge sort
View Answer

Ans : B
Explanation:Selection sort is not a stable sorting algorithm.
23. What is an external sorting algorithm?

A. Algorithm that uses tape or disk during the sort


B. Algorithm that uses main memory during the sort
C. Algorithm that involves swapping
D. Algorithm that are considered ‘in place’
View Answer

Ans : A
Explanation: As the name suggests, external sorting algorithm uses external
memory like tape or disk.

24. If the number of records to be sorted is small, then …… sorting can be


efficient.

A. Merge
B. Heap
C. Selection
D. Bubble
View Answer

Ans : C
Explanation:Selection sorting can be efficient.

25.Suppose we have a O(n) time algorithm that finds median of an unsorted array.
Now consider a QuickSort implementation where we first find median using the
above algorithm, then use median as pivot. What will be the worst case time
complexity of this modified QuickSort.

A. O(n^2 Logn)
B. O(n^2)
C. O(n Logn Logn)
D. O(nLogn)
View Answer

Ans : D
Explanation:If we use median as a pivot element, then the recurrence for all
cases becomes T(n) = 2T(n/2) + O(n) The above recurrence can be solved using
Master Method. It falls in case 2 of master method.

26. Which of the following is not an in-place sorting algorithm?

A. Selection sort
B. Heap sort
C. Quick sort
D. Merge sort
View Answer

Ans : D
Explanation: Merge sort is not an in-place sorting algorithm.

27. What is the advantage of bubble sort over other sorting techniques?

A. It is faster
B. Consumes less memory
C. Detects whether the input is already sorted
D. All of the mentioned
View Answer
Ans : C
Explanation: Bubble sort is one of the simplest sorting techniques and perhaps
the only advantage it has over other techniques is that it can detect whether
the input is already sorted.

28.The complexity of sorting algorithm measures the …… as a function of the


number n of items to be sorter.

A. average time
B. running time
C. average-case complexity
D. case-complexity
View Answer

Ans : B
Explanation:The complexity of sorting algorithm measures the running time as a
function of the number n of items to be sorter.

29. Suppose we are sorting an array of eight integers using quicksort, and we
have just finished the first partitioning with the array looking like this:
2 5 1 7 9 12 11 10
Which statement is correct?

A. The pivot could be either the 7 or the 9.


B. The pivot could be the 7, but it is not the 9
C. The pivot is not the 7, but it could be the 9
D. Neither the 7 nor the 9 is the pivot.
View Answer

Ans : A
Explanation:7 and 9 both are at their correct positions (as in a sorted array).
Also, all elements on left of 7 and 9 are smaller than 7 and 9 respectively and
on right are greater than 7 and 9 respectively.

30.Consider the situation in which assignment operation is very costly. Which of


the following sorting algorithm should be performed so that the number of
assignment operations is minimized in general?

A. Insertion sort
B. Selection sort
C. Heap sort
D. None
View Answer

Ans : B
Explanation:Selection sort.

31.Which of the following is not a stable sorting algorithm in its typical


implementation.

A. Insertion Sort
B. Merge Sort
C. Quick Sort
D. Bubble Sort
ANS:C

32.Which of the following sorting algorithms in its typical implementation gives


best performance when applied on an array which is sorted or almost sorted
(maximum 1 or two elements are misplaced).
A.Quick Sort
B.Heap Sort
C.Merge Sort
D.Insertion Sort
ANS:D

33.Given an unsorted array. The array has this property that every element in
array is at most k distance from its position in sorted array where k is a
positive integer smaller than size of array. Which sorting algorithm can be
easily modified for sorting this array and what is the obtainable time
complexity?

A.Insertion Sort with time complexity O(kn)


B.Heap Sort with time complexity O(nLogk)
C.Quick Sort with time complexity O(kLogk)
D.Merge Sort with time complexity O(kLogk)

ANS:B.Heap Sort with time complexity O(nLogk)

34.Consider a situation where swap operation is very costly. Which of the


following sorting algorithms should be preferred so that the number of swap
operations are minimized in general?

A.Heap Sort
B.Selection Sort
C.Insertion Sort
D.Merge Sort

ANS:B

35.Which of the following is not true about comparison based sorting algorithms?

A.The minimum possible time complexity of a comparison based sorting algorithm


is O(nLogn) for a random input array
B.Any comparison based sorting algorithm can be made stable by using position as
a criteria when two elements are compared
C.Counting Sort is not a comparison based sorting algortihm
D.Heap Sort is not a comparison based sorting algorithm

ANS:D

36.Suppose we are sorting an array of eight integers using quicksort, and we


have just finished the first partitioning with the array looking like this:
2 5 1 7 9 12 11 10
Which statement is correct?
A.The pivot could be either the 7 or the 9.
B.The pivot could be the 7, but it is not the 9
C.The pivot is not the 7, but it could be the 9
D.Neither the 7 nor the 9 is the pivot.

ANS:A

37.Suppose we are sorting an array of eight integers using heapsort, and we have
just finished some heapify (either maxheapify or minheapify) operations. The
array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have
been performed on root of heap?
A.1
B.2
C.3 or 4
D.5 or 6
ANS:B

38.What is the best time complexity of bubble sort?


A.N^2
B.NlogN
C.N
D.N(logN)^2
ANS:C

39.You have to sort 1 GB of data with only 100 MB of available main memory.
Which sorting technique will be most appropriate?
A.Heap sort
B.Merge sort
C.Quick sort
D.Insertion sort
ANS:B

40.What is the worst case time complexity of insertion sort where position of
the data to be inserted is calculated using binary search?
A.N
B.NlogN
C.N^2
D.N(logN)^2
ANS:C

41.The tightest lower bound on the number of comparisons, in the worst case, for
comparison-based sorting is of the order of
A.N
B.N^2
C.NlogN
D.N(logN)^2
ANS:C

42.In a modified merge sort, the input array is splitted at a position one-third
of the length(N) of the array. Which of the following is the tightest upper
bound on time complexity of this modified Merge Sort.
A.N(logN base 3)
B.N(logN base 2/3)
C.N(logN base 1/3)
D.N(logN base 3/2)
ANS:D

43.Which sorting algorithm will take least time when all elements of input array
are identical? Consider typical implementations of sorting algorithms.
A.Insertion Sort
B.Heap Sort
C.Merge Sort
D.Selection Sort
ANS:A
The insertion sort will take \theta(n) time when input array is already sorted.

44.A list of n string, each of length n, is sorted into lexicographic order


using the merge-sort algorithm. The worst case running time of this computation
is
A.O (n log n)
B.O (n2 log n)
C.O (n2 + log n)
D.O (n2)
ANS:B
Explanation:
The recurrence tree for merge sort will have height Log(n). And O(n^2) work will
be done at each level of the recurrence tree (Each level involves n comparisons
and a comparison takes O(n) time in worst case). So time complexity of this
Merge Sort will be O (n^2 log n) .

45.n quick sort, for sorting n elements, the (n/4)th smallest element is
selected as pivot using an O(n) time algorithm. What is the worst case time
complexity of the quick sort? (A) \theta(n) (B) \theta(nLogn) (C) \theta(n^2)
(D) \theta(n^2 log n)
A.A
B.B
C.C
D.D
ANS:B
Explanation:
The recursion expression becomes: T(n) = T(n/4) + T(3n/4) + cn After solving the
above recursion, we get \theta(nLogn).

46.Consider the Quicksort algorithm. Suppose there is a procedure for finding a


pivot element which splits the list into two sub-lists each of which contains at
least one-fifth of the elements. Let T(n) be the number of comparisons required
to sort n elements. Then
A.T(n) <= 2T(n/5) + n
B.T(n) <= T(n/5) + T(4n/5) + n
C.T(n) <= 2T(4n/5) + n
D.T(n) <= 2T(n/2) + n
ANS:B

Explanation:
For the case where n/5 elements are in one subset, T(n/5) comparisons are needed
for the first subset with n/5 elements, T(4n/5) is for the rest 4n/5 elements,
and n is for finding the pivot. If there are more than n/5 elements in one set
then other set will have less than 4n/5 elements and time complexity will be
less than T(n/5) + T(4n/5) + n because recursion tree will be more balanced

47.Which of the following sorting algorithms has the lowest worst-case


complexity?
A.Merge Sort
B.Bubble Sort
C.Quick Sort
D.Selection Sort
ANS:A

Explanation:
Worst case complexities for the above sorting algorithms are as follows: Merge
Sort — nLogn Bubble Sort — n^2 Quick Sort — n^2 Selection Sort — n^2

48.Which sorting algorithms is most efficient to sort string consisting of ASCII


characters?
A.Quick sort
B.Heap sort
C.Merge sort
D.Counting sort
ANS:D
Explanation:
Counting sort algorithm is efficient when range of data to be sorted is fixed.
In the above question, the range is from 0 to 255(ASCII range). Counting sort
uses an extra constant space proportional to range of data.

49.The number of elements that can be sorted in \Theta(logn) time using heap
sort is
(A) \Theta(1)
(B) \Theta(\sqrt{logn})
(C) \Theta(Log n/(Log Log n))
(d) \Theta(Log n)
A.A
B.B
C.C
D.D
ANS:C
50.Which of the following is true about merge sort?
A.Merge Sort works better than quick sort if data is accessed from slow
sequential memory.
B.Merge Sort is stable sort by nature
C.Merge sort outperforms heap sort in most of the practical situations.
D.All of the above.
ANS:D

46.
C-CAT Section B 17 December 2017

1
C-CAT Section B 17 December 2017

2
C-CAT Section B 17 December 2017

3
C-CAT Section B 17 December 2017

4
C-CAT Section B 17 December 2017

5
C-CAT Section B 17 December 2017

6
C-CAT Section B 17 December 2017

7
C-CAT Section B 17 December 2017

8
C-CAT Section B 17 December 2017

9
C-CAT Section B 17 December 2017

http://www.youtube.com/OptimisiticEngineer

10
C-CAT Section A 10 December 2017

1
C-CAT Section A 10 December 2017

2
C-CAT Section A 10 December 2017

3
C-CAT Section A 10 December 2017

4
C-CAT Section A 10 December 2017

5
C-CAT Section A 10 December 2017

6
C-CAT Section A 10 December 2017

7
C-CAT Section A 10 December 2017

http://www.youtube.com/OptimisiticEngineer

8
C-CAT Section A 10 December 2017

9
C-CAT Section A 10 December 2017

10
C-CAT Section A 10 December 2017

11
C-CAT Section A 10 December 2017

12
C-CAT Section A 10 December 2017

13
C-CAT Section A 10 December 2017

14
C-CAT Section A 10 December 2017

15
C-CAT Section A 10 December 2017

16
C-CAT Section B 18 June 2017

1
C-CAT Section B 18 June 2017

2
C-CAT Section B 18 June 2017

3
C-CAT Section B 18 June 2017

4
C-CAT Section B 18 June 2017

5
C-CAT Section B 18 June 2017

6
C-CAT Section B 18 June 2017

7
C-CAT Section B 18 June 2017

8
C-CAT Section B 18 June 2017

9
C-CAT Section B 18 June 2017

10
C-CAT Section B 18 June 2017

11
C-CAT Section B 18 June 2017

12
C-CAT Section B 18 June 2017

13
C-CAT Section B 18 June 2017

14
C-CAT Section B 18 June 2017

http://www.youtube.com/OptimisiticEngineer

15
C-CAT Section B 18 June 2017

1
C-CAT Section B 18 June 2017

2
C-CAT Section B 18 June 2017

3
C-CAT Section B 18 June 2017

4
C-CAT Section B 18 June 2017

5
C-CAT Section B 18 June 2017

6
C-CAT Section B 18 June 2017

7
C-CAT Section B 18 June 2017

8
C-CAT Section B 18 June 2017

9
C-CAT Section B 18 June 2017

10
C-CAT Section B 18 June 2017

11
C-CAT Section B 18 June 2017

12
C-CAT Section B 18 June 2017

13
C-CAT Section B 18 June 2017

14
C-CAT Section B 18 June 2017

http://www.youtube.com/OptimisiticEngineer

15
C-CAT Section A 10 December 2017

1
C-CAT Section A 10 December 2017

2
C-CAT Section A 10 December 2017

3
C-CAT Section A 10 December 2017

4
C-CAT Section A 10 December 2017

5
C-CAT Section A 10 December 2017

6
C-CAT Section A 10 December 2017

7
C-CAT Section A 10 December 2017

http://www.youtube.com/OptimisiticEngineer

8
C-CAT Section A 10 December 2017

9
C-CAT Section A 10 December 2017

10
C-CAT Section A 10 December 2017

11
C-CAT Section A 10 December 2017

12
C-CAT Section A 10 December 2017

13
C-CAT Section A 10 December 2017

14
C-CAT Section A 10 December 2017

15
C-CAT Section A 10 December 2017

16
C-CAT Section B 25 June 2017

1
C-CAT Section B 25 June 2017

2
C-CAT Section B 25 June 2017

3
C-CAT Section B 25 June 2017

4
C-CAT Section B 25 June 2017

5
C-CAT Section B 25 June 2017

6
C-CAT Section B 25 June 2017

7
C-CAT Section B 25 June 2017

8
C-CAT Section B 25 June 2017

9
C-CAT Section B 25 June 2017

10
C-CAT Section B 25 June 2017

11
C-CAT Section B 25 June 2017

12
C-CAT Section B 25 June 2017

13
C-CAT Section B 17 December 2017

1
C-CAT Section B 17 December 2017

2
C-CAT Section B 17 December 2017

3
C-CAT Section B 17 December 2017

4
C-CAT Section B 17 December 2017

5
C-CAT Section B 17 December 2017

6
C-CAT Section B 17 December 2017

7
C-CAT Section B 17 December 2017

8
C-CAT Section B 17 December 2017

9
C-CAT Section B 17 December 2017

10
C-CAT Section A 17 December 2017

1
C-CAT Section A 17 December 2017

2
C-CAT Section A 17 December 2017

3
C-CAT Section A 17 December 2017

4
C-CAT Section A 17 December 2017

5
C-CAT Section A 17 December 2017

6
C-CAT Section A 17 December 2017

7
C-CAT Section A 17 December 2017

8
C-CAT Section A 17 December 2017

9
C-CAT Section A 17 December 2017

10
C-CAT Section C 10 December 2017

1
C-CAT Section C 10 December 2017

2
C-CAT Section C 10 December 2017

3
C-CAT Section C 10 December 2017

4
C-CAT Section C 10 December 2017

5
C-CAT Section C 10 December 2017

6
C-CAT Section C 10 December 2017

7
C-CAT Section C 10 December 2017

8
C-CAT Section C 10 December 2017

9
C-CAT Section C 10 December 2017

10
C-CAT Section C 10 December 2017

11
C-CAT Section C 10 December 2017

12
C-CAT Section C 10 December 2017

13
C-CAT Section C 10 December 2017

14
C-CAT Section C 10 December 2017

15
C-CAT Section C 10 December 2017

16
C-CAT Section B 10 December 2017

1
C-CAT Section B 10 December 2017

2
C-CAT Section B 10 December 2017

3
C-CAT Section B 10 December 2017

4
C-CAT Section B 10 December 2017

5
C-CAT Section B 10 December 2017

6
C-CAT Section B 10 December 2017

7
C-CAT Section B 10 December 2017

8
C-CAT Section B 10 December 2017

9
C-CAT Section B 10 December 2017

10
C-CAT Section B 10 December 2017

11
C-CAT Section B 10 December 2017

12
C-CAT Section B 10 December 2017

13
C-CAT Section B 10 December 2017

http://www.youtube.com/OptimisiticEngineer

14
C-CAT Section A 10 December 2017

1
C-CAT Section A 10 December 2017

2
C-CAT Section A 10 December 2017

3
C-CAT Section A 10 December 2017

4
C-CAT Section A 10 December 2017

5
C-CAT Section A 10 December 2017

6
C-CAT Section A 10 December 2017

7
C-CAT Section A 10 December 2017

http://www.youtube.com/OptimisiticEngineer

8
C-CAT Section A 10 December 2017

9
C-CAT Section A 10 December 2017

10
C-CAT Section A 10 December 2017

11
C-CAT Section A 10 December 2017

12
C-CAT Section A 10 December 2017

13
C-CAT Section A 10 December 2017

14
C-CAT Section A 10 December 2017

15
C-CAT Section A 10 December 2017

16
C-CAT Section B 25 June 2017

1
C-CAT Section B 25 June 2017

2
C-CAT Section B 25 June 2017

3
C-CAT Section B 25 June 2017

4
C-CAT Section B 25 June 2017

5
C-CAT Section B 25 June 2017

6
C-CAT Section B 25 June 2017

7
C-CAT Section B 25 June 2017

8
C-CAT Section B 25 June 2017

9
C-CAT Section B 25 June 2017

10
C-CAT Section B 25 June 2017

11
C-CAT Section B 25 June 2017

12
C-CAT Section B 25 June 2017

http://www.youtube.com/OptimisiticEngineer

13
C-CAT Section B 17 December 2017

1
C-CAT Section B 17 December 2017

2
C-CAT Section B 17 December 2017

3
C-CAT Section B 17 December 2017

4
C-CAT Section B 17 December 2017

5
C-CAT Section B 17 December 2017

6
C-CAT Section B 17 December 2017

7
C-CAT Section B 17 December 2017

8
C-CAT Section B 17 December 2017

9
C-CAT Section B 17 December 2017

http://www.youtube.com/OptimisiticEngineer

http://www.youtube.com/OptimisiticEngineer

10
C-CAT Section B 17 December 2017

1
C-CAT Section B 17 December 2017

2
C-CAT Section B 17 December 2017

3
C-CAT Section B 17 December 2017

4
C-CAT Section B 17 December 2017

5
C-CAT Section B 17 December 2017

6
C-CAT Section B 17 December 2017

7
C-CAT Section B 17 December 2017

8
C-CAT Section B 17 December 2017

9
C-CAT Section B 17 December 2017

http://www.youtube.com/OptimisiticEngineer

http://www.youtube.com/OptimisiticEngineer

10
C-CAT Section B 18 June 2017

1
C-CAT Section B 18 June 2017

2
C-CAT Section B 18 June 2017

3
C-CAT Section B 18 June 2017

4
C-CAT Section B 18 June 2017

5
C-CAT Section B 18 June 2017

6
C-CAT Section B 18 June 2017

7
C-CAT Section B 18 June 2017

8
C-CAT Section B 18 June 2017

9
C-CAT Section B 18 June 2017

10
C-CAT Section B 18 June 2017

11
C-CAT Section B 18 June 2017

12
C-CAT Section B 18 June 2017

13
C-CAT Section B 18 June 2017

14
C-CAT Section B 18 June 2017

http://www.youtube.com/OptimisiticEngineer

15
INSTRUCTIONS TO CANDIDATES

DAC – OOPS with C++ Programming

Candidate should read the following instructions before attempting the question paper.

1. DO NOT CLOSE THE BROWSER ANYTIME DURING THE EXAM.

2. Candidate should check his/her name and extended enrollment Number (enrollment
number prefixed with XX) being displayed on the screen. In case of any discrepancy, it
should be reported to Invigilator immediately.

3. Candidate should ensure that he/she has marked attendance on the attendance sheet and
also ensure that session id has also been recorded. Any other session id which has not been
mentioned in the attendance sheet would not be considered and all responses on that
session id would be treated as null and void.

4. Do not start the exam (do not click Next button) before instructed to do so by the
Invigilator.

5. Every Section has 40 objective-type questions. Each objective-type question has four
choices of which only one is correct. Candidate should select the radio button, given below
the question, corresponding to his/her correct choice.

6. Marking scheme of CCEE is as follows:

a. +1 (plus one) marks for each correct answer.


b. 0 (zero) mark for each un-attempted/ wrong question.

7. Duration of each Section is One hour. No candidate will be allowed to leave the
examination hall before the completion of exam duration.

8. On clicking the Next button given at the bottom of the Instructions page, candidate will
be directed to the question display screen.

9. Candidate should note down the Session ID that is displayed on the question screen after
clicking on Next button.

10. Once the exam is started:-


a. Candidate should not close the browser. In case the browser is closed accidentally,
it SHOULD BE reported to the Invigilator immediately.
b. Candidate should not open any other software application on the computer system.
c. Candidate should neither shut down the machine nor fiddle with allocated hardware
or software.
d. In case of any problem it should be reported to Invigilator.

11. Candidate can navigate through questions using scroll bar or directly through the question
number grid.

12. CCEE screen contains the following buttons with the below specified functionality:

Button Functionality

Examination This link will open the instructions for the exam. After reading the
Instruction instructions candidate has to click on Back button to move back to the
questions interface.

Mark for In case a candidate is not sure about the answer, then he/she can use this
Review Button to mark the question for a visit later. It will be shown with
a ? against the question (in the question number grid) if the question has
not been answered but has marked it for review. In case candidate has
answered the question and marked it for review, then √? will be displayed
against the question in the question number grid.

Clear Answer This button will clear the option marked and the question will be shown
as un-answered.

13. Each candidate will be provided one A4 size sheet for rough work. Candidates have to
record their Name, hall ticket number and session ID on the rough sheet. They have to
return the rough sheet to the Invigilator before leaving the exam hall.
14. Calculators, mobile phones, pagers and electronic gadgets in any form are not allowed to be
used in the Exam Hall.

15. Candidate will be disqualified if found indulging in any kind of malpractice.


1. Which of the following type of pointer restricts changes in value/variable pointed by it?
A. Constant pointer to variable
B. Constant pointer to constant value
C. Pointer to variable
D. NULL pointer

2. What would be the equivalent pointer expression for the array element a[i][j][k][l]

A. ((((a+i)+j)+k)+l)
B. *(*(*(*(a+i)+j)+k)+l)
C. (((a+i)+j)+k+l)
D. ((a+i)+j+k+l)

3. Which of the following is correct about class and structure?


A. class can have member functions while structure cannot have member functions.
B. class data members are public by default while structure members are private.
C. Pointer to structure or classes cannot be declared.
D. class data members are private by default while structure members are public.

4. If default constructor is not defined, then how the objects of the class will be created?
A. The compiler will generate error.
B. Error will occur at run-time.
C. Compiler provides its default constructor to build the object.
D. None of these

5. All the classes in C++ standard library are included in _______ namespace.
A. std
B. object
C. io
D. None of above

6. Which of the constructor will initialize variable changeme correctly?


#include <iostream>
using namespace std;
class Test
{
const int changeme;
public:
void Display()
{
cout<<"\n"<< changeme <<endl;
}
};
A:Test(int k):changeme(k)
{
}
B:Test(int k)
{
changeme = k;
}
C:Test()
{
changeme = 0;
}
D: None of the above

7. When << operator is overloaded in a class it ______________.


A. must be a member function.
B. must be a non-member function.
C. can be both A & B.
D. cannot be overloaded

8. Which of the function can be overloaded?


A. Virtual function
B. Static function
C. Member function
D. All of the above

9. Which statement is correct about the static data member of a class?


A. static member function can access only static data members of a class.
B. static data member is not shared among all the object of the class.
C. static data member can be accessed from main() and other functions.
D. None of the above.

10. Which type of function is an ideal candidate for being declared as inline?
A. A function that is not called frequently and it is small.
B. A function that is called frequently and it is small.
C. A function that is not called frequently and it is large.
D. A function that is large and is called frequently
11.double(*temp[10])();
temp here is _______
A. pointer to a function
B. pointer array
C. array of pointer to a function
D. pointer to array of function

12. What will be the output of following code snippet?


#include <iostream>
using namespace std;
class ThisTest
{
int datamember;
public:
ThisTest(int datamember)
{
this->datamember = datamember;
this = new ThisTest;
this->datamember = 100;
}
void Display()
{
cout<<"Member:"<<datamember;
}
};
int main()
{
ThisTest thistest(50);
thistest.Display();
return 0;
}
A. 50
B. 100
C. Garbage value
D. Compilation error
13.What kind of function does not have this pointer?
A. Overloaded Function
B. Friend Function
C. Virtual Function
D. None is true.

14.What is the value of n?


enum color { red, green = 20, blue , yellow = 23};
color col = red;
int n = blue;
A. 21
B. blue
C. 3
D. Error in syntax

15. In binary operator overloaded function, which are overloaded through friend function
take_____.
A. Three explicit arguments
B. Two explicit arguments
C. One explicit arguments
D. No arguments

16. Compiler provided copy constructor always perform?


A. Shallow copy
B. Deep copy
C. Memory allocation
D. None of these

17.Return type of constructors are ____


A. 1
B. 0
C. void
D. It does not have a return type.

18. Which of the following describes inheritance and composition correctly?


A. There is no difference in inheritance and composition
B. Composition and inheritance can be used for creation of child classes
C. Composition provide is-a and inheritance provide has-a relationship between classes
D. Composition allow to use existing functionality of class whereas inheritance allow to
extend original functionality of class
19. For runtime polymorphism, a method in base class must be declared _______________
A. static
B. constant
C. friend
D. virtual

20.Which of the following is/are incorrect w.r.t Virtual function?


A. A virtual function is a member function that you expect to be redefined in derived
classes.
B. Virtual functions ensure that the correct function is called for an object, regardless of
the expression used to make the function call.
C. When you refer to a derived class object using a pointer or a reference to the base
class, you can call a virtual function for that object and execute the derived class's
version of the function.
D. You can also declare global or static functions as virtual.

21. What will be the output of below code snippet?

#include<iostream>
using namespace std;
class Parent
{
public:
virtual void Function()
{
cout<<"\n Parent Class Function.";
}
};
class Child: public Parent
{
public:
void Function()
{
cout<<"\n Child Class Function.";
}
};
int main(int argc, char* argv[])
{
Parent *ptrParent = NULL;
Child objChild;
ptrParent = &objChild;
ptrParent->Function();
}
A. Parent Class Function
B. Child Class Function
C. Compilation error
D. Logical error

22. Which statement is used to catch all types of exceptions?


A. catch()
B. catch(int a)
C. catch(…)
D. catch(runtime_error e)

23.In case of multiple inheritance, diamond problem can be resolved by____________?


A. Virtual base classes
B. Virtual functions
C. Virtual constructor
D. Virtual destructor

24.A class is called as Abstract class if it contains __________.


A. At least one virtual function
B. At least one pure virtual function
C. No virtual functions
D. Virtual constructor

25. class A { int I; };

class B: virtual public A

{ int j; };

class C: virtual public A

{ int k; };

class D:public B, C

{ int l; };

void main() { cout << sizeof(B) << “,” << sizeof(C) << “,” << sizeof(D);

}
A. 8,8,16

B. 12,12,24

C. 12,12,20

D. 12,12,28

26. class A {

public:

void print() { cout << “print of A” << endl; }

virtual void draw(){ cout << “draw of A” << endl;}

};

class B: public A {

public: virtual void print() { cout << “print of B” << endl;}

};

class C: public B {

public: void print() { cout << “print of C” << endl;}

};

void main() { C c; B *pb = &c; pb->draw();

(a) Print “draw of A”


(b) Compiling error
(c) runtime error
(d) None of above
27. What is output by the following segment of code?

for (int I = 1; I <= 5; I++)


for (int J = 1; J <= 3; J++)
cout << J;
A. 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
B. 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
C. 1 2 3 2 3 3
D. 1 2 3 4 5

28. What is the output of the following code?


#include<iostream.h>
int a = 1;
void main()
{
int a = 100;
{
int a = 200;
{
int a = 300;
cout<<a<<",";
}
cout<<a<<",";
}
cout<<a<<",";
cout<<::a<<",";
}
A. Error
B. 100, 200, 300, 100,
C. 300, 200, 100, garbage

D. 300, 200, 100, 1

29. What is the behavior of this program?


int main()
{
int x = -1;
try
{
if (x < 0)
throw x;
else
cout<<x;
}
catch (int x )
{
cout << " Thrown value is " << x << endl;
}
return 0;
}
A. Thrown value is -1, Exception not occurred.
B. Thrown value is 1, Exception not occurred.
C. Thrown value is 1, Exception occurred.
D. Thrown value is -1, Exception occurred.

30.In the template <class T> declaration, T stands for______________.


A. An integer data type
B. A generic data type
C. An arbitrary class
D. A class defined earlier

31. What will be the output of below code snippet?


#include<iostream>
using namespace std;
int main()
{
cout.fill('#');
cout.width(10);
cout<<"Hello"<<endl;
return 0;
}

A. Hello#####
B. #####Hello
C. Hello
D. Compilation error
32.In C++, cout represents __________________.
A. istream
B. ostream
C. iostream
D. ifstream

33. Which of the following stream(s) used for reading and writing content?
A. fstream
B. stringstream
C. iostream
D. All of the above

34.Which of the following file opening mode will create file if file does not exists and put
write marker to end if file exists?
A. ios::out
B. ios::trunc
C. ios::ate
D. ios::binary

35. In CPP, which operator is used to release the dynamically allocated memory?
A. remove
B. free
C. delete
D. release

36.What is functionality of seekp?


A. return current location of read marker
B. move read marker to given position
C. return current location of write marker
D. move write marker to given position

37. If j = 0, k = 2 and m = 14, what value is stored in n?

n = (k && m) + (j < (k/m)) + (j || (!m)) +(m/k);

A. 0
B. 1
C. 7
D. 8
38. Predict the output of the following code?

#include <iostream>
using namespace std;
void show (int& a, int& b, int& c)
{
a *= 3;
b *= 9;
c *= 4;
}
int main ()
{
int x = 4, y = 7, z = 6;
show (x, y, z);
cout << x <<" "<< y<<" " << z;
return 0;
}
A. 4 7 6
B. 3 9 4
C. 12 63 24
D. 9 81 16

39.In C++, which of the following advanced type casting mechanism is used for constant
to non-constant conversion?
A. static_cast
B. const_cast
C. reinterpret_cast
D. dynamic_cast

40. What is the output of the following code snippet?

class test {
public:
static int n;
test () { n++; };
~test () { n--; };
};
int test::n=0;
int main () {
test a;
test b[5];
test * c = new test;
cout << a.n << endl;
delete c;
cout << test::n << endl;
return 0;
}
A. 7 6
B. 6 7
C. 5 6
D. 6 5
INSTRUCTIONS TO CANDIDATES

DAC – Data structure

Candidate should read the following instructions before attempting the question paper.

1. DO NOT CLOSE THE BROWSER ANYTIME DURING THE EXAM.

2. Candidate should check his/her name and extended enrollment Number (enrollment
number prefixed with XX) being displayed on the screen. In case of any discrepancy, it
should be reported to Invigilator immediately.

3. Candidate should ensure that he/she has marked attendance on the attendance sheet and
also ensure that session id has also been recorded. Any other session id which has not been
mentioned in the attendance sheet would not be considered and all responses on that
session id would be treated as null and void.

4. Do not start the exam (do not click Next button) before instructed to do so by the
Invigilator.

5. Every Section has 40 objective-type questions. Each objective-type question has four
choices of which only one is correct. Candidate should select the radio button, given below
the question, corresponding to his/her correct choice.

6. Marking scheme of CCEE is as follows:

a. +1 (plus one) marks for each correct answer.


b. 0 (zero) mark for each un-attempted/ wrong question.

7. Duration of each Section is One hour. No candidate will be allowed to leave the
examination hall before the completion of exam duration.

8. On clicking the Next button given at the bottom of the Instructions page, candidate will
be directed to the question display screen.

9. Candidate should note down the Session ID that is displayed on the question screen after
clicking on Next button.

10. Once the exam is started:-

a. Candidate should not close the browser. In case the browser is closed accidentally,
it SHOULD BE reported to the Invigilator immediately.
b. Candidate should not open any other software application on the computer system.
c. Candidate should neither shut down the machine nor fiddle with allocated hardware
or software.
d. In case of any problem it should be reported to Invigilator.

11. Candidate can navigate through questions using scroll bar or directly through the question
number grid.

12. CCEE screen contains the following buttons with the below specified functionality:

Button Functionality

Examination This link will open the instructions for the exam. After reading the
Instruction instructions candidate has to click on Back button to move back to the
questions interface.

Mark for In case a candidate is not sure about the answer, then he/she can use this
Review Button to mark the question for a visit later. It will be shown with
a ? against the question (in the question number grid) if the question has
not been answered but has marked it for review. In case candidate has
answered the question and marked it for review, then √? will be displayed
against the question in the question number grid.

Clear Answer This button will clear the option marked and the question will be shown
as un-answered.

13. Each candidate will be provided one A4 size sheet for rough work. Candidates have to
record their Name, hall ticket number and session ID on the rough sheet. They have to
return the rough sheet to the Invigilator before leaving the exam hall.
14. Calculators, mobile phones, pagers and electronic gadgets in any form are not allowed to be
used in the Exam Hall.

15. Candidate will be disqualified if found indulging in any kind of malpractice.


1. Which of the following will help to find creative solution to problem?
A. Brainstorming, Reverse Brainstorming, Mind Mapping
B. Coding
C. Testing
D. Feasibility study

2. A queue has been implemented with a linked list, keeping track of a front node and rear node
with two reference variables. Which of these reference variables will change during an insertion
into an EMPTY queue?

A. Neither changes
B. Only rear changes.
C. Only front changes.
D. Both change.

3. Which of the following is fastest searching algorithm?


A. Hashing
B. Linear search
C. Binary search
D. Fibonacci search

4. Identify the correct sequence of below actions for implementing decisions?


I. Create an action plan
II. Prioritize actions and assign roles
III. Break solution into action steps
IV. Follow‐up at milestones
A. I, III, II, IV
B. I, II, III, IV
C. I, IV, II, III
D. IV, III, II, I

5. Circular queue uses memory locations by resetting rear and front markers with the help
of _____________ operator.
A. ->
B. %
C. ::
D. New
6. Pointer of the last node points to the first node of list in ______________.
A. Stacks
B. Queue
C. Circular Queue
D. Priority Queue

7. Elements can be added or removed from both the ends of a data structure of type
_____.
A. Stack
B. Circular queue
C. Dequeue
D. Priority queue

8. Memory is utilized optimally in case of ____________.


A. Arrays
B. Linked Lists
C. Tree
D. Graph

9. Pointing to a previous node and next node is possible in __________.


A. Singly linked list
B. Doubly linked list
C. Circularly linked list
D. none

10. Which of the following best describes the operation of the Dequeue class?

A. First in first out.


B. First in last out.
C. Last in first out.
D. Data can be inserted from any end.

11. If numbers of elements are not known in advance, the best implementation is _______.
A. Array
B. Linked list
C. Structure
D. Union
12. Which of following is false about Tree?
A. Tree is acyclic connected graph
B. Tree is non-linear data structure
C. There can be multiple root nodes in tree
D. The height or depth of tree is defined to be maximum level of node in that tree

13. A tree node with no children is called as …………. node.


A. Leaf node
B. Root node
C. Parent node
D. Ancestor node

14. In which of the following tree height of left sub tree and height of right sub tree differ at
most by one?
A. AVL Tree
B. Expression Tree
C. Threaded Binary Tree
D. B Tree

15. Which of the following operation is performed to balance AVL tree?


A. Insert
B. Rotate
C. Shift
D. Delete

16. For a binary search to be performed, the elements are to be in __________.


A. sorted list
B. any order
C. all +ve
D. non zero elements

17. Re-arranging elements according to a well defined ordering rule is called ___________.
A. Searching
B. Indexing
C. Sorting
D. Analyzing
18. Repeatedly selecting the smallest remaining item is done for which type of sorting
______.
A. Selection sort
B. Insertion sort
C. Bubble sort
D. radix sort

19. If elements are almost ordered, the preferable sorting technique is____________.
A. Selection sort
B. Bubble sort
C. heap sort
D. Merge sort

20. Search algorithm for hashing consists of _______________.


A. Hash function
B. Collision resolution
C. Hash function and Distribution
D. Hash function and Collision resolution

21. Hashing with linear probing method is called __________.


A. open addressing
B. close addressing
C. Double hashing
D. Hash functioning

22. A Graph traversal technique is __________.


A. Pre order
B. Post order
C. Breadth first
D. Height first

23. A graph in which edges have direction is called as___________.


A. Diagraph
B. Complete graph
C. Undirected graph
D. None of these
24. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
A. ABFCDE
B. ADBFEC
C. ABDECF
D. ABDCEF

25. Breadth First Search graph traversal method makes use of ___________ data structure.
A. Tree
B. Stack
C. Queue
D. Linked list

26. Depth First Search graph traversal method makes use of ………. data structure.
A. Tree
B. Stack
C. Queue
D. Linked list

27. Graph can be represented using ___________________.


A. Adjacency matrix
B. Sparse matrix
C. Adjacency list
D. All of the above

28. Which of the following is/are variations to the greedy algorithm?


A. Pure greedy algorithms
B. Orthogonal greedy algorithms
C. Relaxed greedy algorithms
D. All of the above

29. Which of the following is not Dynamic Programming approach?


A. Forward approach
B. Backward approach
C. Bidirectional approach
D. None of these
30. Which of the following are true about divide and conquer algorithms?
A. Divide and conquer algorithm design paradigm based on multi-branched recursion.
B. A divide and conquer algorithm works by recursively breaking down a problem into two
or more sub-problems of the same type
C. Quick sort and merge sort use divide and conquer
D. All of the above

31. The Linked list in which last node of Linked List points to first node and first node also
points to last node is called as______________.
A. Singly Linked List
B. Doubly Linked List
C. Circular Singly Linked List
D. Circular Doubly Linked List

32. How many pointers need to be modified to insert node in Circular Doubly Linked List?
A. One
B. Two
C. Four
D. Five

33. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is


A. 600
B. 350.
C. 650.
D. 588.

34. A Data Structure that allows accessing elements in the order of LIFO is ____________.
A. Stack
B. Queue
C. Tree
D. Graph

35. Two main measures for the efficiency of an algorithm are…….


A. Processor and memory
B. Complexity and capacity
C. Time and space
D. Data and space
36. In a singly linked list if a new node is to be inserted between two consecutive nodes how
many links have to be modified?

A. 1
B. 2
C. 3
D. 4

37. Which of the following is not related to problem solving cycle?


A. Identify the problem
B. Define the problem
C. Combine relevant and irrelevant information
D. Identify a strategy

38. . The equivalent prefix expression for the following infix expression (A+B)-(C+D*E)/F*G is
A. -+AB*/+C*DEFG
B. /-+AB*+C*DEFG
C. -/+AB*+CDE*FG
D. -+AB*/+CDE*FG

39. Here is an infix expression: 4+3*(6*3-12). Suppose that we are using the usual stack
algorithm to convert the expression from infix to postfix notation. What is the maximum number
of symbols that will appear on the stack AT ONE TIME during the conversion of this
expression?

A. 1
B. 2
C. 3
D. 4

40. How many null pointer/s exist in a circular double linked list?

A. 1
B. 2
C. 3
D. 0
C-CAT Section C 10 December 2017

1
C-CAT Section C 10 December 2017

2
C-CAT Section C 10 December 2017

3
C-CAT Section C 10 December 2017

4
C-CAT Section C 10 December 2017

5
C-CAT Section C 10 December 2017

6
C-CAT Section C 10 December 2017

7
C-CAT Section C 10 December 2017

8
C-CAT Section C 10 December 2017

9
C-CAT Section C 10 December 2017

10
C-CAT Section C 10 December 2017

11
C-CAT Section C 10 December 2017

12
C-CAT Section C 10 December 2017

13
C-CAT Section C 10 December 2017

14
C-CAT Section C 10 December 2017

15
C-CAT Section C 10 December 2017

16
C-CAT Section B 10 December 2017

1
C-CAT Section B 10 December 2017

2
C-CAT Section B 10 December 2017

3
C-CAT Section B 10 December 2017

4
C-CAT Section B 10 December 2017

5
C-CAT Section B 10 December 2017

6
C-CAT Section B 10 December 2017

7
C-CAT Section B 10 December 2017

8
C-CAT Section B 10 December 2017

9
C-CAT Section B 10 December 2017

10
C-CAT Section B 10 December 2017

11
C-CAT Section B 10 December 2017

12
C-CAT Section B 10 December 2017

13
C-CAT Section B 10 December 2017

http://www.youtube.com/OptimisiticEngineer

14
C-CAT Section A 10 December 2017

1
C-CAT Section A 10 December 2017

2
C-CAT Section A 10 December 2017

3
C-CAT Section A 10 December 2017

4
C-CAT Section A 10 December 2017

5
C-CAT Section A 10 December 2017

6
C-CAT Section A 10 December 2017

7
C-CAT Section A 10 December 2017

http://www.youtube.com/OptimisiticEngineer

8
C-CAT Section A 10 December 2017

9
C-CAT Section A 10 December 2017

10
C-CAT Section A 10 December 2017

11
C-CAT Section A 10 December 2017

12
C-CAT Section A 10 December 2017

13
C-CAT Section A 10 December 2017

14
C-CAT Section A 10 December 2017

15
C-CAT Section A 10 December 2017

16
C-CAT Section B 25 June 2017

1
C-CAT Section B 25 June 2017

2
C-CAT Section B 25 June 2017

3
C-CAT Section B 25 June 2017

4
C-CAT Section B 25 June 2017

5
C-CAT Section B 25 June 2017

6
C-CAT Section B 25 June 2017

7
C-CAT Section B 25 June 2017

8
C-CAT Section B 25 June 2017

9
C-CAT Section B 25 June 2017

10
C-CAT Section B 25 June 2017

11
C-CAT Section B 25 June 2017

12
C-CAT Section B 25 June 2017

http://www.youtube.com/OptimisiticEngineer

13
C-CAT Section B 17 December 2017

1
C-CAT Section B 17 December 2017

2
C-CAT Section B 17 December 2017

3
C-CAT Section B 17 December 2017

4
C-CAT Section B 17 December 2017

5
C-CAT Section B 17 December 2017

6
C-CAT Section B 17 December 2017

7
C-CAT Section B 17 December 2017

8
C-CAT Section B 17 December 2017

9
C-CAT Section B 17 December 2017

http://www.youtube.com/OptimisiticEngineer

http://www.youtube.com/OptimisiticEngineer

10
C-CAT Section B 18 June 2017

1
C-CAT Section B 18 June 2017

2
C-CAT Section B 18 June 2017

3
C-CAT Section B 18 June 2017

4
C-CAT Section B 18 June 2017

5
C-CAT Section B 18 June 2017

6
C-CAT Section B 18 June 2017

7
C-CAT Section B 18 June 2017

8
C-CAT Section B 18 June 2017

9
C-CAT Section B 18 June 2017

10
C-CAT Section B 18 June 2017

11
C-CAT Section B 18 June 2017

12
C-CAT Section B 18 June 2017

13
C-CAT Section B 18 June 2017

14
C-CAT Section B 18 June 2017

http://www.youtube.com/OptimisiticEngineer

15
Sunbeam_Day4_OS_MCQ’s
1 Physical memory is broken into fixed-sized blocks called ________
a) frames
b) pages
c) backing store
d) none of the mentioned

Ans:A
2 Logical memory is broken into blocks of the same size called
_________
a) frames
b) pages
c) backing store
d) none of the mentioned

Ans:B
3 Every address generated by the CPU is divided into two parts :
a) frame bit & page number
b) page number & page offset
c) page offset & frame bit
d) frame offset & page offset

Ans:B
4 The __________ is used as an index into the page table.
a) frame bit
b) page number
c) page offset
d) frame offset
Ans:B
5 The _____ table contains the base address of each page in physical
memory.
a) process
b) memory
c) page
d) frame

Ans:C
6 The size of a page is typically :
a) varied
b) power of 2
c) power of 4
d) none of the mentioned

Ans:B
7 With paging there is no ________ fragmentation.
a) internal
b) external
c) either type of
d) none of the mentioned

Ans:B
8 Virtual memory allows :
a) execution of a process that may not be completely in memory
b) a program to be smaller than the physical memory
c) a program to be larger than the secondary storage
d) execution of a process without being in physical memory

Ans:A
9 Virtual memory is normally implemented by ________
a) demand paging
b) buses
c) virtualization
d) all of the mentioned

Ans:A
10 The valid – invalid bit, in this case, when valid indicates :
a) the page is not legal
b) the page is illegal
c) the page is in memory
d) the page is not in memory

Ans:C
11 A page fault occurs when :
a) a page gives inconsistent data
b) a page cannot be accessed due to its absence from memory
c) a page is invisible
d) all of the mentioned

Ans:B
12 In segmentation, each address is specified by :
a) a segment number & offset
b) an offset & value
c) a value & segment number
d) a key & value

Ans:A
13 In paging the user provides only ________ which is partitioned by
the hardware into ________ and ______
a) one address, page number, offset
b) one offset, page number, address
c) page number, offset, address
d) none of the mentioned

Ans:A

14 Each entry in a segment table has a :


a) segment base
b) segment peak
c) segment value
d) none of the mentioned

Ans:A
15 The segment base contains the :
a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) none of the mentioned
Ans:B
16 The segment limit contains the :
a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) none of the mentioned

Ans:C
17 _____ is the concept in which a process is copied into main
memory from the secondary memory according to the
requirement.
a) Paging
b) Demand paging
c) Segmentation
d) Swapping

Ans:B
18 A process is thrashing if
a) it is spending more time paging than executing
b) it is spending less time paging than executing
c) page fault occurs
d) swapping can not take place
Ans:A
19 The three major methods of allocating disk space that are in wide
use are :
a) contiguous
b) linked
c) indexed
d) all of the mentioned

Ans:D
20 In contiguous allocation :
a) each file must occupy a set of contiguous blocks on the disk
b) each file is a linked list of disk blocks
c) all the pointers to scattered blocks are placed together in one
location
d) none of the mentioned

Ans:A
21 In linked allocation :
a) each file must occupy a set of contiguous blocks on the disk
b) each file is a linked list of disk blocks
c) all the pointers to scattered blocks are placed together in one
location
d) none of the mentioned
Ans:B
22 In indexed allocation :
a) each file must occupy a set of contiguous blocks on the disk
b) each file is a linked list of disk blocks
c) all the pointers to scattered blocks are placed together in one
location
d) none of the mentioned

Ans:C
23 Contiguous allocation of a file is defined by :
a) disk address of the first block & length
b) length & size of the block
c) size of the block
d) total size of the file

Ans:A
24 _______ and ________ are the most common strategies used to
select a free hole from the set of available holes.
a) First fit, Best fit
b) Worst fit, First fit
c) Best fit, Worst fit
d) None of the mentioned
Ans:A
25 For each file there exists a ___________ that contains information
about the file, including ownership, permissions and location of the
file contents.
a) metadata
b) file control block
c) process control block
d) all of the mentioned

Ans:B
26 Metadata includes :
a) all of the file system structure
b) contents of files
c) both file system structure and contents of files
d) none of the mentioned

Ans:C
27 In the linked allocation, the directory contains a pointer to the :
I. first block
II. last block
a) I only
b) II only
c) Both I and II
d) Neither I nor II

Ans:C
28 There is no __________ with linked allocation.
a) internal fragmentation
b) external fragmentation
c) starvation
d) all of the mentioned

Ans:B
29 The major disadvantage with linked allocation is that :
a) internal fragmentation
b) external fragmentation
c) there is no sequential access
d) there is only sequential access

Ans:D
30 Contiguous allocation has two problems _________ and _________
that linked allocation solves.
a) external – fragmentation & size – declaration
b) internal – fragmentation & external – fragmentation
c) size – declaration & internal – fragmentation
d) memory – allocation & size – declaration
Ans:A
31 Each _______ has its own index block.
a) partition
b) address
c) file
d) all of the mentioned

Ans:C
32 Indexed allocation _________ direct access.
a) supports
b) does not support
c) is not related to
d) none of the mentioned

Ans:A
33 A memory page containing a heavily used variable that was
initialized very early and is in constant use is removed, then the
page replacement algorithm used is :
a) LRU
b) LFU
c) FIFO
d) None of the mentioned
Ans:C
34 The aim of creating page replacement algorithms is to :
a) replace pages faster
b) increase the page fault rate
c) decrease the page fault rate
d) to allocate multiple pages to processes

Ans:C
35 A FIFO replacement algorithm associates with each page the
_______
a) time it was brought into memory
b) size of the page in memory
c) page after and before it
d) all of the mentioned

Ans:A

36 Optimal page – replacement algorithm is :


a) Replace the page that has not been used for a long time
b) Replace the page that has been used for a long time
c) Replace the page that will not be used for a long time
d) None of the mentioned

Ans:C
37 Optimal page – replacement algorithm is difficult to implement,
because :
a) it requires a lot of information
b) it requires future knowledge of the reference string
c) it is too complex
d) it is extremely expensive

Ans:B
38 In the ______ algorithm, the disk arm starts at one end of the disk
and moves toward the other end, servicing requests till the other
end of the disk. At the other end, the direction is reversed and
servicing continues.
a) LOOK
b) SCAN
c) C-SCAN
d) C-LOOK

Ans:B
39 In the _______ algorithm, the disk head moves from one end to
the other , servicing requests along the way. When the head
reaches the other end, it immediately returns to the beginning of
the disk without servicing any requests on the return trip.
a) LOOK
b) SCAN
c) C-SCAN
d) C-LOOK
Ans:C
40 In the ______ algorithm, the disk arm goes as far as the final
request in each direction, then reverses direction immediately
without going to the end of the disk.
a) LOOK
b) SCAN
c) C-SCAN
d) C-LOOK

Ans:A
C-CAT Section B 18 June 2017

1
C-CAT Section B 18 June 2017

2
C-CAT Section B 18 June 2017

3
C-CAT Section B 18 June 2017

4
C-CAT Section B 18 June 2017

5
C-CAT Section B 18 June 2017

6
C-CAT Section B 18 June 2017

7
C-CAT Section B 18 June 2017

8
C-CAT Section B 18 June 2017

9
C-CAT Section B 18 June 2017

10
C-CAT Section B 18 June 2017

11
C-CAT Section B 18 June 2017

12
C-CAT Section B 18 June 2017

13
C-CAT Section B 18 June 2017

14
C-CAT Section B 18 June 2017

15

You might also like