Algorithms Quiz

Results

#1 What is the time complexity of f(n) in terms of Big-O-Notation?

#2 The picture depicts a sorting technique called?

#3 There are two bulbs A and B. ON(A) – represents that the bulb A is ON OFF(A) – represents that the bulb A is OFF Similarly, ON(B) and OFF(B) represents the ON and OFF states of bulb B respectively. Which of the following Boolean expression is true? (Consider ON state as True and OFF state as False)

#4 Which of the following is false about algorithms?

#5 Algorithm A has a time complexity of O(n^2 ) and Algorithm B has a time complexity of O(n) where n is an integer such that n > 0. If both the algorithms are made to run at the same time on two different machines that have exactly same features, which algorithm halts first?

#6 Choose the algorithm

#7 Consider the following insertion sort program. How will the array “a” look like after the first iteration of the for loop?

#8 In which of the following sorting techniques, does the last element of the array get sorted first?

#9 What is the time complexity of the above code? (v4)

#10 Which of the following statements is true about Average case time complexities of the given sorting algorithms?

#11 Following is a code segment for Selection sort. Analyze the code and determine the final array ‘ a ‘.

next

#12 What is the output of the following code segment which does binary search. Here, ‘a’ is an array and “target” is an integer element we are searching for in the array.

#13 In the picture below, the arrow represents a robot. The robot can move in the white square boxes but not in the black colored region. Which of the following code segments can move the robot to the blue colored square?

finish