• Courses
  • Tutorials
  • Practice
  • Contests
Switch to Dark Mode

DSA Tutorial - Two Pointer Technique: Question 8

Last Updated : Feb 5, 2025
Discuss
Comments

Consider an array consisting of –ve and +ve numbers. What would be the worst case time complexity to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other using two pointer technique?

A

O(N log N)

B

O(N)

C

O(N * N)

D

O(log N)

Tags:
Share your thoughts in the comments