码迷,mamicode.com
首页 >  
搜索关键字:leecode duplicates    ( 1908个结果
在一个数组中除两个数字只出现1次外,其它数字都出现了2次
前面总结了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
[leetcode] Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:其他好文   时间:2014-07-02 00:33:49    阅读次数:204
[leetcode] Remove Duplicates from Sorted List II
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
LeetCode——Search Insert Position
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
leecode Binary Tree Level Order Traversal II java
做完这道题,只能说基本功很重要,数组中套数组就不会用了,过几天吧1做了,看自己到底等没。https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/import java.util.*;/** * Definition ...
分类:编程语言   时间:2014-07-01 13:30:53    阅读次数:300
树的最大深度 leecode java
秒杀/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = ...
分类:编程语言   时间:2014-07-01 13:16:49    阅读次数:174
树中是否存在路径和为 sum leecode java
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
leecode 树是否是平衡树 java
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
LeetCode——Remove Duplicates from Sorted Array
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!