Interview Question

Lead Automation Engineer (T5) Interview

-Bangalore

NextGen Healthcare

1. Write a program to arrange 1s and 0s from an array in the given order. Cont. with Time & space complexity questions.

AnswerAdd Tags

Interview Answer

1 Answer

0

2 approaches with O(n) complexity first with counting and overwriting 1 & 0 in the desired order and second with in place swapping mismatched elements.

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.