Computer Science, asked by joginder7812, 11 months ago

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 a

Answers

Answered by Anonymous
1

Answer:

Here we can use the partition algorithm of quick sort for segregation and answer will be O(N).

Choose the first element as pivot whatever may be its sign we don’t care and keep an extra index at pivot position.

...

Similar questions
Math, 6 months ago