move zeros leetcode
来源:互联网 发布:网络剧如何赚钱 编辑:程序博客网 时间:2024/04/27 14:09
Just use the thought of Bubble sort.
I think it would have an O(n) algriothm, I would try it later.
public class Solution { public void moveZeroes(int[] nums) { for(int j = 0;j < nums.length;j++) { for(int i = 0; i < nums.length - j; i++) { if(nums[i] == 0) if(i+1 < nums.length - j) { int temp = nums[i]; nums[i] = nums[i+1]; nums[i+1] = temp; } } } }}
0 0
- 【leetcode】283. Move Zeros
- Leetcode Move Zeros
- (java)leetcode Move Zeros
- move zeros leetcode
- 【leetcode】:move zeros
- leetcode Move Zeros
- leetcode之move zeros
- leetcode之 Move Zeros
- leetcode:Move Zeros
- 283.[LeetCode]Move Zeros
- LeetCode: Move Zeros
- leetCode:283.Move Zeros
- Leetcode 283 Move zeros
- leetcode【283 Move Zeros】【python】
- LeetCode笔记:Move Zeros[Difficulty: Easy]
- [LeetCode练习题-C语言]之 Move Zeros
- LeetCode 283. Move Zeros 解题报告
- leetcode-283-Move Zeros 顺序表
- wince软件开发人员应了解的socket网络编程一(摘录)
- wince软件开发人员应了解的socket网络编程二(摘录)
- c程序代码重构(摘)
- arm映象结构(转/实践测试)
- 常用辅助类——JSON,XML,模型互转,MD5,Base64
- move zeros leetcode
- 王亟亟的Python学习之路(三)-基础语法以及基本数据类型
- 解决apache没有权限响应的问题
- UIScrollView
- android打造仿qq控件可拉伸头部控件
- java正则匹配html片段,并取得标签中的内容
- Jesse的第一篇博客
- 关于循环队列的一些讲解
- 【经验】使用Profiler工具分析内存占用情况