前面总结了leecode上,改为成3出现,只有1个出现1次,的是通过记录每个位的个数来实现的如果count%3=1则为1,否则为0,实现起来充分利用了位运算。编程之美上的,没有写过,今天写一下。http://blog.csdn.net/morewindows/article/details/8214...
分类:
其他好文 时间:
2014-07-03 10:33:52
阅读次数:
220
想起那夕阳下的奔跑,那是我逝去的青春 ----万万没想到我一看到,就觉得很简单,因为就是那个大数相加的思想啊,后来才知道各种情况,调了2个多小时,坑爹,不过leecode测试用例非常好。1.链表合并,跟那个有序链表合并为一个类似,2.合并之后,利用大数相加,超过十进位,最后一个节点要特殊处理,我写....
分类:
其他好文 时间:
2014-07-02 21:05:19
阅读次数:
194
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:
其他好文 时间:
2014-07-02 00:33:49
阅读次数:
204
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分类:
其他好文 时间:
2014-07-02 00:24:04
阅读次数:
284
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array....
分类:
其他好文 时间:
2014-07-01 15:22:44
阅读次数:
140
做完这道题,只能说基本功很重要,数组中套数组就不会用了,过几天吧1做了,看自己到底等没。https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/import java.util.*;/** * Definition ...
分类:
编程语言 时间:
2014-07-01 13:30:53
阅读次数:
300
秒杀/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = ...
分类:
编程语言 时间:
2014-07-01 13:16:49
阅读次数:
174
https://oj.leetcode.com/problems/path-sum//** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNod...
分类:
编程语言 时间:
2014-07-01 13:09:20
阅读次数:
198
https://oj.leetcode.com/problems/validate-binary-search-tree/1.中序遍历是否有序/** * Definition for binary tree * public class TreeNode { * int val; * ...
分类:
编程语言 时间:
2014-07-01 12:20:06
阅读次数:
173
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with...
分类:
其他好文 时间:
2014-06-30 17:22:13
阅读次数:
196