码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
23. Merge k Sorted Lists
题目:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.链接:http://leetcode.com/problems/merge-k-sorted-list...
分类:其他好文   时间:2015-04-17 15:34:07    阅读次数:122
Leetcode Merge k Sorted Lists
题目地址:https://leetcode.com/problems/merge-k-sorted-lists/题目解析:采用二分归并法,将链表分为两部分,两部分合并后再将结果合并;对其中的每一部分的合并采用递归的方法进行。题目解答:/** * Definition for singly-linke...
分类:其他好文   时间:2015-04-17 01:01:35    阅读次数:114
给定一个闭区间,计算这个区间内所有整数与的结果
题目来自LeetCode,连接为https://leetcode.com/problems/bitwise-and-of-numbers-range/比如给定区间[5,7],要求返回结果5 & 6 & 7 = 4仔细分析题目,可以发现还是很简单的,不管有多少个数,某一位上只要有一个0,那么最终结果在...
分类:其他好文   时间:2015-04-17 00:55:52    阅读次数:183
外链接
第一次刷SQL题目感觉还是不错的。这个题目(https://leetcode.com/problems/combine-two-tables/)大概是说把第一张表和第二张表连接起来。而且第二张表中的Person的Address中的属性可能为NULL。这明显就是个左外链接。?123# Write yo...
分类:其他好文   时间:2015-04-16 23:29:50    阅读次数:141
记一次jeecg启动出错的解决
启动报错: java.lang.Error: Unresolved compilation problems:? The import org.apache.poi.hssf.usermodel.HSSFWorkbook cannot be resolved The type JeecgSingleExcelView must implement the inherited ab...
分类:其他好文   时间:2015-04-16 12:38:33    阅读次数:571
Pascal's Triangle I, II
题目链接https://leetcode.com/problems/pascals-triangle/https://leetcode.com/problems/pascals-triangle-ii/这两道题都是数组操作,需要注意的是II在I的基础上使用滚动数组存储过往的中间结果,这个思想可以注意...
分类:其他好文   时间:2015-04-16 06:44:20    阅读次数:110
Merge Sorted Array
题目链接https://leetcode.com/problems/merge-sorted-array/这道题是merge sort中merge的过程,有一个trick是从后往前merge,这样可以避免多余的数组操作class Solution {public: void merge(int...
分类:其他好文   时间:2015-04-16 06:44:10    阅读次数:121
Majority Element
题目链接https://leetcode.com/problems/majority-element/这道题最一开始的思路是建立一个hashmap,这样就是 O(n) time和 O(n) space。但是后来看了一下leetcode给出的官方解答,发现moore voting algorithm很...
分类:其他好文   时间:2015-04-16 06:42:58    阅读次数:102
Plus One
题目链接https://leetcode.com/problems/plus-one/这是digit这类题里最简单的一道了,这类题基本都不难,但是需要把几个boundary case考虑到,这道题里需要考虑的是进位之后首位的情况。其他case以后遇到再提。class Solution {public...
分类:其他好文   时间:2015-04-16 06:42:24    阅读次数:131
Remove Element
题目链接https://leetcode.com/problems/remove-element/这道题比较简单,为了维护这个leetcode系列的完整性,我依然把它加在这里,code如下class Solution {public: int removeElement(int A[], in...
分类:其他好文   时间:2015-04-16 06:42:02    阅读次数:109
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!