Skip to content

Commit

Permalink
SortColors : Updated javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gouthampradhan committed Aug 6, 2017
1 parent 9126057 commit 55efe49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions problems/src/array/SortColors.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
Could you come up with an one-pass algorithm using only constant space?
Solution:
The below solution works with one pass. The basic idea is to keep track of start and end index of
contiguous 1s and push the 0s to left of 1s and 2 to right of 1s.
*/
public class SortColors {
/**
Expand Down

0 comments on commit 55efe49

Please sign in to comment.