Data Structures :: Complexity

NA
SHSTTON
31
Solv. Corr.
34
Solv. In. Corr.
65
Attempted
0 M:7 S
Avg. Time

1 / 14

Choose the correct option.

The complexity of searching an element from a set of n elements using Binary search algorithm is


AO(n)

BO(log n)

CO(n^2)

DO(n log n)

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
73
Solv. Corr.
13
Solv. In. Corr.
86
Attempted
0 M:0 S
Avg. Time

2 / 14

Choose the correct option.

Two main measures for the efficiency of an algorithm are


ATime and space

BProcessor and memory

CComplexity and capacity

DData and space

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
29
Solv. Corr.
58
Solv. In. Corr.
87
Attempted
0 M:0 S
Avg. Time

3 / 14

Choose the correct option.

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


AO(1)

BO(n*log n)

CO(n)

DO(n^2)

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
31
Solv. Corr.
49
Solv. In. Corr.
80
Attempted
0 M:0 S
Avg. Time

4 / 14

Choose the correct option.

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


AStack implemented using queues

BDoubly linked list

CCircular queue

DQueue implemented using stacks

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
29
Solv. Corr.
53
Solv. In. Corr.
82
Attempted
0 M:0 S
Avg. Time

5 / 14

Choose the correct option.

Which algorithm is having highest space complexity?


ABubble sort

BInsertion Sort

CQuick Sort

DMerge Sort

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
25
Solv. Corr.
49
Solv. In. Corr.
74
Attempted
0 M:0 S
Avg. Time

6 / 14

Choose the correct option.

quicksort algorithm is used to sort an array of N elements. If all the N values w
complexity of quicksort that uses first element as the pivot. ?


AO(N*N)

BO(1)

CO(N)

DO(N log N)

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
29
Solv. Corr.
35
Solv. In. Corr.
64
Attempted
0 M:0 S
Avg. Time

7 / 14

Choose the correct option.

Algorithms A and B solve the same problem. Time complexity of A is in O(n^2) and that of B is in O(n). Which among the following can you guarantee?


AA is having less executable instructions than B

BA is having more number of functions than B

CA is having less number of functions than B

DA is having more executable instructions than B

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
53
Solv. Corr.
21
Solv. In. Corr.
74
Attempted
0 M:0 S
Avg. Time

8 / 14

Choose the correct option.

The complexity of merge sort algorithm is


AO(n)

BO(log n)

CO(n2)

DO(n log n)

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
52
Solv. Corr.
22
Solv. In. Corr.
74
Attempted
0 M:0 S
Avg. Time

9 / 14

Choose the correct option.

The complexity of linear search algorithm is


AO(n)

BO(log n)

CO(n2)

DO(n log n)

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
30
Solv. Corr.
44
Solv. In. Corr.
74
Attempted
0 M:0 S
Avg. Time

10 / 14

Choose the correct option.

The complexity of Binary search algorithm is


AO(n)

BO(log )

CO(n2)

DO(n log n)

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace