MCQ On Complexity Algorithms - Data Structure

21. if for an algorithm time complexity is given by O(n2) then complexity will:

A. constant
B. quardratic
C. exponential
D. none of the mentioned

View Answer


22. If for an algorithm time complexity is given by O((3⁄2)n) then complexity will:

A. constant
B. quardratic
C. exponential
D. none of the mentioned

View Answer


23. the time complexity of binary search is given by:

A. constant
B. quardratic
C. exponential
D. none of the mentioned

View Answer


24. The time complexity of linear search is given by:

A. O(log2n)
B. O(1)
C. exponential
D. none of the mentioned

View Answer


25. Which algorithm is better for sorting between bubble sort and quicksort?

A. bubble sort
B. quick sort
C. both are equally good
D. none of the mentioned

View Answer


26. State true or false
Time complexity of binary search algorithm is constant

A. True
B. False

View Answer


27. Two main measures for the efficiency of an algorithm are

A. Time and space
B. Processor and memory
C. Complexity and capacity
D. Data and space

View Answer


28. Which is the best data structure for round robin algorithm for CPU scheduling?

A. Stack implemented using queues
B. Doubly linked list
C. Circular queue
D. Queue implemented using stacks

View Answer


29. Which algorithm is having highest space complexity?

A. Bubble sort
B. Insertion Sort
C. Quick Sort
D. Merge Sort

View Answer


30. If the array is already sorted, then the running time for merge sort is: ?

A. O(1)
B. O(n*log n)
C. O(n)
D. O(n^2)

View Answer






Also Check :


Discussion


* You must be logged in to add comment.