1. Which of the following is true about graph?
a. A graph may contain many edges and no vertices
b. A graph may contain no vertices and many edges
c. A graph may contain no edges and many vertices
d. A graph may contain no edges and no vertices
1. Which of the following options is an instance of divide and conquer
a. merge sort
b. Bubble sort
c. selection sort
d. insertion sort
1. Given a directed graph G with the set of edges E = { (1, 2), (2, 4), (4, 2) (4, 1)} what will be the set of edge of it transpose?
a. E = { (4, 1), (4, 2) (2, 4), (1, 2)}
b. E = { (1, 2), (2, 4), (4, 2) (4, 1)}
c. None of the options
d. E = { (2, 1), (4,2), (2, 4) (1,4)}
1. An array contains five numbers 12,5,7,-1,2 to be sorted. If after the first iteration, the array is now 5,7,-1, 2, 12. Which algorithm is being used?
a. insertion sort
b. merge sort
c. selection sort
d. Bubble sort
1. Which of the following algorithms relies on the principle of optimality?
a. Divide and Conquer
b. Quick search algorithm
c. Greedy algorithm
d. Dynamic Programming
1. An array A[0..n-1] is sorted using the Insertion sort algorithm. The worst case and the best case running time of this computation respectively are
a. O (n log n) and O (n)
b. O (n2) and O (n)
c. O (n log n) and O (n log n)
d. O (n) and O (n log n)
1. An array A[0..n-1] is sorted using the merge-sort algorithm. The worst case and the best case running time of this computation respectively are
a. O (n) and O (n log n)
b. O (n log n) and O (n)
c. O (n log n) and O (n log n)
d. O (n2) and O (n log n)
1. Consider the problem of searching an element x in an array of size n. which class of algorithm can we use If we want to solve the problem in O(Logn)
a. Divide and Conquer
b. Best first search algorithm
c. Greedy algorithm
d. Dynamic Programming
1. Which of the following sorting algorithm is not in place?
a. merge sort
b. Bubble sort
c. selection sort
d. insertion sort
1. The sorting technique where array to be sorted is partitioned again and again in such a way that all elements less than or equal to partitioning element appear before it and those which are greater appear after it, is called
a. insertion sort
b. merge sort
c. selection sort
d. Quicksort