Computer Science Study Materials for Competitive Exams

Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Friday, 8 September 2017

Data Structures and Algorithms Multiple Choice Questions - Set 18

171.       Project scheduling is an example of ................
(A) Greedy programming
(B) Dynamic programming
(C) Divide and conquer
(D) None of the above.
Answer: B
172.       Minimum number of queues required for priority queue implementation?
(A) 5
(B) 4
(C) 3
(D) 2
Answer: D
173.       From a complete graph, by removing maximum ................ edges, we can construct a spanning tree.
(A) e-n+1
(B) n-e+1
(C) n+e-1
(D) e-n-1
Answer: A
174.       Which of these algorithmic approaches tries to achieve localized optimum solution?
(A) Greedy approach
(B) Divide and conquer approach
(C) Dynamic approach
(D) All of the above
Answer: A
175.       In worst case Quick Sort has order ..............
(A) O(n log n)
(B) O(n2/2)
(C) O(log n)
(D) O(n2/4)
Answer: B

176.       To partition unsorted list a pivot element is used in ...............
(A) Merge Sort
(B) Quick Sort
(C) Insertion Sort
(D) Selection Sort
Answer: B
177.       What is the worst case time complexity of linear search algorithm?
(A) Ο(1)
(B) Ο(n)
(C) Ο(log n)
(D) Ο(n2)
Answer: D
Linear search scans sequentially to find the target value. The best case is Ο(1) and average and worst case is Ο(n). Worst case is when data is not in the list, and it has to scan all n elements.
178.       A full binary tree with 2n+1 nodes contain ................
(A) n leaf nodes
(B) n non-leaf nodes
(C) n-1 leaf nodes
(D) n-1 non-leaf nodes
Answer: B
179.       Which of the following statements about stacks is incorrect?
(A) Stacks can be implemented using linked lists.
(B) Stacks are first-in, first-out (FIFO) data structures.
(C) New nodes can only be added to the top of the stack.
(D) The last node (at the bottom) of a stack has a null (0) link.
Answer: B
180.    If a node in a BST has two children, then its in-order predecessor has .............
(A) no left child
(B) no right child
(C) two children
(D) no child
Answer: B

Pages  17   18   19   20   21   22 

No comments:

Post a Comment