Flashcards
Move Zeroes
Cards in this deck (1)
- 1Shift all zeroes to the endpublic void moveZeroes(int[] nums) {
int pos = 0;
int loc = 0;
for(int i = 0; i < nums.length; i++){
if(nums[i]!=0) {
nums[pos++] = nums[i];
}
}
for(int i = pos;i
Information
- Description
- Flashcards on Move Zeroes, created by Suhas S on 12/02/2018.
- Created by
- Suhas S
- Views
- 10
- Rating