Last active
August 29, 2015 14:21
-
-
Save supritashankar/f9e5a28d399f812a63c2 to your computer and use it in GitHub Desktop.
Buckets-robo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Buckets Robo problem | |
Attempt #1 | |
""" | |
begin = -1; | |
end = len(no_of_buckets); | |
loc = 0; | |
while (loc<end) { | |
switch (color) { | |
case Red: | |
begin++; | |
swap(buckets[loc], buckets[begin]); | |
loc++; | |
break; | |
case Blue: | |
end--; | |
swap(buckets[loc], buckets[end]); | |
break; | |
case Green: | |
loc++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment