Correct Answer : Option (C) : A procedure for solving a problem
Correct Answer : Option (D) : Single source shortest path
Explanation : Dijkstra’s algorithm is used to solve single source shortest path problems.
Correct Answer : Option (A) : Divide and Conquer
Correct Answer : Option (B) : Merge
Correct Answer : Option (A) : O(1)
Correct Answer : Option (C) : O(n^2)
Correct Answer : Option (A) : 148
Correct Answer : Option (D) : Merge Sort
Correct Answer : Option (C) : Dynamic programming algorithms
Correct Answer : Option (C) : Both (A) and (B)
Correct Answer : Option (B) : B is better than A
Correct Answer : Option (A) : Insertion
Correct Answer : Option (D) : 6 8 1 3 12
Correct Answer : Option (C) : Insertion
Correct Answer : Option (C) : 2
Correct Answer : Option (A) : Binary
Correct Answer : Option (D) : All of the above
Explanation : Algorithm is represented through pseudo codes, normal language sentences or flow charts.
Correct Answer : Option (C) : Correctness and Precision
Explanation : An algorithm should be correct otherwise it’s of no use even if it is fast and compact.
Correct Answer : Option (B) : making that algorithm fast by time and compact by space
Explanation : An Algorithm should be fast and compact.
Correct Answer : Option (A) : Brute Force
Explanation : In Brute force, all the possibilities are tried.
Correct Answer : Option (B) : a base case is not necessary
Correct Answer : Option (C) : Prim's Minimum Spanning Tree
Correct Answer : Option (D) : Heap Sort is not a comparison based sorting algorithm.
Correct Answer : Option (A) : n^3 / (sqrt(n))
Correct Answer : Option (A) : Bubble
Correct Answer : Option (D) : Make a new list with the first item of the original list as the ordered list
Correct Answer : Option (C) : Compare 2 and 1 and put 1 into a new list
Correct Answer : Option (B) : Insertion
Correct Answer : Option (B) : Binary search
Correct Answer : Option (A) : Elements do not need to be in order, check each item in turn
Correct Answer : Option (D) : Take an ordered list, compare the search value to the middle value, if it's higher than the middle take the right side of the list otherwise take the left and repeat
Correct Answer : Option (C) : Hashing
Correct Answer : Option (A) : Worst than Average case
Correct Answer : Option (B) : O(n)
Correct Answer : Option (D) : Counting the number of key operations
Correct Answer : Option (D) : Linked List
Correct Answer : Option (C) : Divide and conquer
Correct Answer : Option (A) : log(n)
Correct Answer : Option (B) : O(n2)
Correct Answer : Option (C) : best case: O(n log(n) ) worst case: O(n2)
Correct Answer : Option (D) : Developing an algorithm to solve a problem
Correct Answer : Option (A) : Typing
Correct Answer : Option (B) : Representing real world problems in a computer program, using symbols and removing unnecessary elements
Correct Answer : Option (B) : The breaking down of a problem into smaller problems
Correct Answer : Option (D) : Identifying the steps involved in solving a problem
Correct Answer : Option (C) : The steps that are taken to solve a problem
Correct Answer : Option (A) : num1=input("Enter the first number") num2=input("Enter the second number") num3=num1+num2 print(num3)
Correct Answer : Option (D) : number=input("Enter a number") for x = 1 to 12 print(number*x) next x
Correct Answer : Option (B) : number = input(“Enter a number”) number2 = input(“Enter the second number”) final = (((number + number2) * 11) + 4) / 2 print (final)
Correct Answer : Option (A) : Merge
Correct Answer : Option (C) : Bubble
Correct Answer : Option (B) : the greatest common divisor of x and y
Correct Answer : Option (A) : Tower of hanoi
Correct Answer : Option (C) : T(n) = Omega(n^2)
Correct Answer : Option (D) : n( k – 1) + 1
Correct Answer : Option (B) : Theta(n^3)
f(int Y[10], int x) { int i, j, k; i = 0; j = 9; do { k = (i + j) /2; if( Y[k] < x) i = k; else j = k; } while(Y[k] != x && i < j); if(Y[k] == x) printf ("x is in the array ") ; else printf (" x is not in the array ") ; }
On which of the following contents of Y and x does the program fail?
Correct Answer : Option (A) : Y is [2 2 2 2 2 2 2 2 2 2] and x > 2
Explaination : The above program doesn’t work for the cases where element to be searched is the last element of Y[] or greater than the last element (or maximum element) in Y[]. For such cases, program goes in an infinite loop because i is assigned value as k in all iterations, and i never becomes equal to or greater than j. So while condition never becomes false.
Correct Answer : Option (C) : 0, 10, 110, 1110, 11110, 11111
Correct Answer : Option (A) : 1.9375
Correct Answer : Option (B) : 34
Correct Answer : Option (C) : MOD
Correct Answer : Option (A) : Boolean
Explanation : The Bellmann Ford Algorithm returns a boolean value.
Correct Answer : Option (D) : Backtracking
Correct Answer : Option (B) : Abstract Data Type
Correct Answer : Option (C) : Underflow
Correct Answer : Option (A) : NP-complete problem
Correct Answer : Option (D) : Dynamic Programming
Correct Answer : Option (B) : Continuous Knapsack Problem
Correct Answer : Option (C) : O(V + E)
Correct Answer : Option (D) : Counting Sort
Correct Answer : Option (A) : O(nlog(logn)) Precomputation, O(1) for check.
Correct Answer : Option (B) : T(n)= T(n/2)+k
Correct Answer : Option (A) : Quadratic
Correct Answer : Option (C) : less than deterministic algorithm
Correct Answer : Option (B) : 14
Explanation :
Correct Answer : Option (D) : 2
Correct Answer : Option (A) : Post-order Traveral
Correct Answer : Option (C) : 9, 8, 6, 3, 3, 1
Explanation : A sequence of values is said to be in non-increasing order, if the successive element is less than or equal to its previous element in the sequence.
Correct Answer : Option (C) : pivot element
Correct Answer : Option (B) : takes advantage of already sorted elements.
Explanation : A sorting algorithm is said to be adaptive, if it takes advantage of already 'sorted' elements in the list that is to be sorted.
Correct Answer : Option (D) : In-Place
Correct Answer : Option (A) : Insertion Sort
Correct Answer : Option (D) : Djikstra’s Algorithm
Correct Answer : Option (C) : O(logN)
Correct Answer : Option (B) : 0/1 Knapsack Problem
Correct Answer : Option (C) : Complete binary tree
Correct Answer : Option (A) : n - 1
Correct Answer : Option (D) : e-n+1
Explanation : We can remove maximum e-n+1 edges to get a spanning tree from complete graph. Any more deletion of edges will lead the graph to be disconnected.
e-n+1
Correct Answer : Option (A) : 9 edges
Correct Answer : Option (B) : T(n2), T(n log n) and T(n2)
Correct Answer : Option (C) : The 3-SAT problem can be reduced to it in polynomial time
Correct Answer : Option (C) : Exactly 1
Correct Answer : Option (D) : Greedy Algorithm
Correct Answer : Option (B) : peek()
Correct Answer : Option (A) : f4(n) = 2^n.
begin q := 0 r := x while r >= y do begin r := r – y q := q + 1 end end
Correct Answer : Option (C) : {x = qy + r ∧ r < y}
Explaination :
begin q := 0 // q is going to contain floor(x/y) r := x // r is going to contain x % y // Repeatedly subtract y from x. while r >= y do begin r := r – y q := q + 1 end end
Correct Answer : Option (A) : When elements are sorted in ascending order
Correct Answer : Option (D) : Rectangle