Algorithms Design and Analysis Mcqs With Answers Set 1

April 2, 2018 | Author: Kande Archana K | Category: Vertex (Graph Theory), Mathematical Relations, Algorithms, Computer Programming, Discrete Mathematics


Comments



Description

ALGORITHMS DESIGN ANDANALYSIS MCQS WITH ANSWERS SET 1 ALGORITHMS DESIGN AND ANALYSIS MCQS WITH ANSWERS Algorithms Design And Analysis MCQS with Answers is mainly intended fro GATE aspirants.These questions can also came in Btech Computer science university exams and various interview for computer science students (01) Which of the following properties are necessary for an Algorithm? (A) Definite ness (B) correct ness (C) Effectiveness (D) A and C (02) which of the following technique is not using for solve a 0-1knapsack problem (A) Greedy above (B) Dynamic programming (C) branch and bound (D) all of the (03)For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i<n; i++) A[i] = +; (A) O(n-1) (B) O(n) (C) O(n2) (D) O(log n) (04) For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i< n; i++) For (j=i; j< n; j++) For (k=j; k< n; k++) S++; (A) O(n-1) (B) O(n2) (C) O(n3) (D) O(log n) (05) For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i < n*n; i++) A[i] = i; (A) O(n-1) (B) O(n2) (C) O(n3) (D) O(log n) (06) Given f(n) = log2n, g(n) = √n which function is asymptotically faster (A) f(n) is faster than g(n) (B) g(n) is faster than f(n) (C) Either f(n) or g(n) (D) Neither f(n) nor g(n) (07) Which of the following are true (a) 33n3 + 4n2 = p (n2) (b) n! = O(nn) (c) 10n2+ 9 = O(n2) (d) 6n3 /(log n +1) T (1) = 1 then T (n) = (A) ϴ (n2) (B) ϴ (n3) (C) ϴ (n4) (D) ϴ (n) (10) T (n) = 3T (n/4) + n then T (n) = (A) O (n2) (B) O (n3) (C) O (n) (11) T (n) = 4T (n/2) + n then T (n) = (A) ϴ (n2) (B) ϴ (n3) (C) ϴ (n4) (D) O (n4) (D) ϴ (n) (12) T (n) = 2T (n/2) + cn then T (n) = (A) O (log n) (C) O (n2log n) (B) O (n log n) (D) O (n2) (13) T (n) = 2T (n/2) + n2 then T (n) = (A) ϴ (n2) (B) ϴ (n3) (C) ϴ (n4) (D) ϴ (n) (14) T (n) = 2T (n/2) + n2 then T (n) = (A) O (n3) (B) O (n2) (C) O (n) (D) O (n4) (15) T (n) = 9T (n/3) + n then T (n) = (A) ϴ (n4) (B) ϴ (n3) (C) ϴ (n2) (D) ϴ (n) Algorithms Design And Analysis MCQS with Answers' 1D 2A 3B 4C 5B 6A 7D 8C 9B 10C 11A .b and c (B)a and c (C) a and b (D) all are true (08) n! = (A) O( 2n) None- (B) ω(2n) (C) A and B (D) O(n100) (09) T (n) = 8T (n/2) + n2.= O(n3) (A) a. iii) A graph is said to be complete if there is no edge between every pair of vertices. i) Network is a graph that has weights or costs associated with it. False . A) True. A) Weakly connected B) Strongly Connected C) Tightly Connected D) Linearly Connected 2.12B 13A 14B 15C 1. ii) An undirected graph which contains no cycles is called a forest. State True of False. True. if there is a path from each vertex to every other vertex in the digraph. False.. A directed graph is ………………. A) Depth First B) Breadth First C) With First D) Depth Limited 3. In the ……………. True B) True. traversal we process all of a vertex’s descendants before we move to an adjacent vertex. The number of comparisons done by sequential search is ……………… A) (N/2)+1 B) (N+1)/2 C) (N-1)/2 D) (N+2)/2 6. True. True. c-ii D) a-i. b-i. A) Linear search . b-ii. Match the following. c-ii 5. True 4. c-i B) a-i. search start at the beginning of the list and check every element in the list. A) a-iii. a) Completeness i) How long does it take to find a solution b) Time Complexity ii) How much memory need to perform the search. c-iii C) a-iii. In ……………. c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one. b-ii. b-iii.C) True. True D) False. False D) True. State True or False. True C) False. ii) The time complexity of binary search is O(logn).B) Binary search C) Hash Search D) Binary Tree search 7. . True 8. i) An undirected graph which contains no cycles is called forest. ii) A graph is said to be complete if there is an edge between every pair of vertices. Which of the following is not the internal sort? A) Insertion Sort B) Bubble Sort C) Merge Sort D) Heap Sort 9. False B) False. i) Binary search is used for searching in a sorted array. A) True. State True or False. respectively. the initial values of front pointer f rare pointer r should be …….A) True. A) r=r+1 . False 10. True C) False.. A graph is said to be ……………… if the vertices can be split into two sets V1 and V2 such there are no edges between two vertices of V1 or two vertices of V2. False D) True.. In a circular queue the value of r will be . In a queue. True B) False.. A) Partite B) Bipartite C) Rooted D) Bisects 11. and ………. A) 0 and 1 B) 0 and -1 C) -1 and 0 D) 1 and 0 12. is that they solve the problem if sequential storage representation.B) r=(r+1)% [QUEUE_SIZE – 1] C) r=(r+1)% QUEUE_SIZE D) r=(r-1)% QUEUE_SIZE 13. A) i-only B) ii-only C) Both i and ii D) None of both 14. A) Lists B) Linked Lists C) Trees D) Queues 15. What will be the value of top. The advantage of …………….. Which of the following statement is true? i) Using singly linked lists and circular list. it is required to traverse the list from the first node in case of singly linked list. it is not possible to traverse the list backwards. But disadvantage in that is they are sequential lists. if there is a size of stack STACK_SIZE is 5 . ii) To find the predecessor. A) 5 B) 6 C) 4 D) None 16. ………… is not the operation that can be performed on queue. And line segments called arcs or ………. A) Antinel B) Sentinel C) List header D) List head 18. . that connect pair of nodes. There is an extra element at the head of the list called a ………. A graph is a collection of nodes. called ………. A) Insertion B) Deletion C) Retrieval D) Traversal 17.. edges B) edges. A) [log2n]-1 B) [logn]+1 C) [log2n] D) [log2n]+1 Answers: 1. comparisons. B) Strongly Connected . edges 19. is a graph that has weights of costs associated with its edges. In general. paths D) graph node. the binary search method needs no more than …………….. A ……….A) vertices. vertices C) vertices. A) Network B) Weighted graph C) Both A and B D) None A and B 20. C) Both i and ii 14. False 4. C) 4 16. B) Linked Lists 15. True10. B) 0 and -1 12. A) Linear search 7. c-ii 5. A) Depth First 3. D) Traversal 17. b-i.2. A) True. A) vertices. C) r=(r+1)% QUEUE_SIZE 13. B) True. D) [log2n]+1 . True 8. C) a-iii. C) Merge Sort 9. edges 19. D) True. C) Both A and B 20. True. B) Sentinel 18. B) (N+1)/2 6. B) Bipartite 11.
Copyright © 2024 DOKUMEN.SITE Inc.