862 views
0 0 votes

Consider an array consisting of –ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other ?

(A)

N-1

(B)

N

(C)

N+1

(D)

(N*(N-1))/2

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
1 1 answer
934
934 views
Khushi739 asked Jun 5, 2024
934 views
Let A1, A2, A3, and A4 be four matrices of dimensions 10 x 5, 5 x 20, 20 x 10, and 10 x 5, respectively. The minimum number of scalar multiplications required to find the...
1 1 vote
0 0 answers
8.8k
8.8k views
Hirak asked May 20, 2019
8,830 views
What does it mean when we say that an algorithm X is asymptotically more efficient than Y?(A) X will be a better choice for all inputs(B) X will be a better choice for al...
0 0 votes
0 0 answers
1.1k
1.1k views
Ashish Goyal asked Jan 26, 2019
1,053 views
Compute minimum spanning tree for the following undirected, weighted graph, using Prim's algorithmThe weight and number of spanning tree(s) are _____________ .A38 and 2 r...
0 0 votes
2 answers 2 answers
1.5k
1.5k views
Rustam Ali asked Sep 3, 2018
1,484 views
Find time complexity of below Program?A(n){if(n<=1) return;elsereturn $A(\sqrt{n})$ ;}