Email: bbcnoun@gmail.com Whatsapp/Telegram: 08131667008 CIT341 Question: Which of the following declaration tells the compiler that there is exactly one copy of this variable x in existence Answer: static int x= 30; Question: 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 Answer: Quicksort Question: Which of the following options is an instance of divide and conquer Answer: Bubble sort Question: 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 Answer: O (n log n) and O (n log n) Question: Which of the following sorting algorithm is not in place? Answer: Bubble sort Question: 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 Answer: O (n2) and O (n) Question: Which of the following data structures uses FIFO method? Answer: Queue Question: What is the value of 3+4%6/2+5? Answer: 10 Question: Which of the following is correct way to declare variables in Java? Answer: int height, width; Question: Which of the following algorithms relies on the principle of optimality? Answer: Dynamic Programming Question: 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? Answer: E = {(2, 1), (4,2), (2, 4) (1,4)} Question: Which of the following is true about graph? Answer: A graph may contain no edges and many vertices Question: Given that int x, y; and that x < y what is the value of x % y? Answer: x Question: What is the value of 3+4%6/2+5? Answer: 10 Question: 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) Answer: Divide and Conquer Question: An array contains five the 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? Answer: Bubble sort Question: Which of the following declaration tells the compiler that there is exactly one copy of this variable x in existence Answer: static int x= 30; Question: 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 Answer: Quicksort Email: bbcnoun@gmail.com Whatsapp/Telegram: 08131667008