Question DSA-TP-0031
EasyMoving all zeros to the end of an array while keeping the order of the other elements can be done in:
- A.
O(log n) time
- B.
O(n log n) time only
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Two Pointers and Sliding Window question
Moving all zeros to the end of an array while keeping the order of the other elements can be done in:
O(log n) time
O(n log n) time only
Sign up free to see the answer and a step-by-step explanation.
O(n) time with two pointers
O(n²) time only