E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
lintCode
Lintcode
248 Count of Smaller Number solution 题解
【题目描述】Giveyouanintegerarray(indexfrom0ton-1,wherenisthesizeofthisarray,valuefrom0to10000)andanquerylist.Foreachquery,giveyouaninteger,returnthenumberofelementinthearraythataresmallerthanthegivenintege
程风破浪会有时
·
2017-11-17 10:56
一些比较好的国外IT网站
1、在线编程练习:
LintCode
——在线刷题网站,阶梯式训练,可帮助你更快速深入地了解各类面试题型,提供专业导师写的最优代码作为参考(
Lintcode
标准答案查询——
lintcode
的参考答案网站,提供最优解
fzy1017692329
·
2017-11-16 01:40
Lintcode
107 Word Break solution 题解
【题目链接】www.
lintcode
.com/en/problem
AdmondGuo
·
2017-11-16 00:25
算法
面试题
lintcode
Lintcode
382 三角形计数
给定一个整数数组,在该数组中,寻找三个数,分别代表三角形三条边的长度,问,可以寻找到多少组这样的三个数来组成三角形?例如,给定数组S={3,4,6,7},返回3其中我们可以找到的三个三角形为:{3,4,6}{3,6,7}{4,6,7}c++:一般而言,做ACM之类的题,不要考虑暴力搜索,有很大可能会超时,这个点考虑小技巧先sort,再,如例1,当S[k]=7时,i初始化为0,j初始化为k-1,那么
Charles_k
·
2017-11-15 13:52
lintcode
在二叉树中插入节点
(不使用递归)来源:
LintCode
作者:syt日期:2017-11-13思路:用一个节点preNode记录最后一个节点,当遍历到为空时,根据插入节点的值与preNode的值比较,大于preNode的值插入到
孙小小子
·
2017-11-13 21:03
C++
算法学习
Lintcode
227 Mock Hanoi Tower by Stacks solution 题解
【题目描述】IntheclassicproblemofTowersofHanoi,youhave3towersandNdisksofdifferentsizeswhichcanslideontoanytower.Thepuzzlestartswithdiskssortedinascendingorderofsizefromtoptobottom(i.e.,eachdisksitsontopofan
程风破浪会有时
·
2017-11-13 00:08
Lintcode
211 :字符串置换
**
Lintcode
211:字符串置换**题干描述:给定两个字符串,请设计一个方法来判定其中一个字符串是否为另一个字符串的置换。置换的意思是,通过改变顺序可以使得两个字符串相等。
zyp960621
·
2017-11-12 20:37
Lintcode
LintCode
211. 字符串置换
描述:给定两个字符串,请设计一个方法来判定其中一个字符串是否为另一个字符串的置换。置换的意思是,通过改变顺序可以使得两个字符串相等。样例:“abc”为“cba”的置换。“aabc”不是“abcc”的置换。思路:写一个函数将字符串转换成字符数组,调用c函数库里的sort函数快排,再转化成字符串比较,简单题,没必要多讲classSolution{public:/**@paramA:astring*@p
Charles_k
·
2017-11-12 14:32
c++
lintcode
lintcode
211 字符串置换
采用设置标志数组的方法,一定程度上降低了时间复杂度;publicclassSolution{/**@paramA:astring*@paramB:astring*@return:aboolean*/publicbooleanPermutation(StringA,StringB){//writeyourcodehereif(A.length()!=B.length()){returnfalse;}
赵冠晨
·
2017-11-09 11:15
lintcode
[
Lintcode
]二叉树的最大节点 java实现
在二叉树中寻找值最大的节点并返回。样例给出如下一棵二叉树:1/\-52/\/\03-4-5返回值为3的节点。/***DefinitionofTreeNode:*publicclassTreeNode{*publicintval;*publicTreeNodeleft,right;*publicTreeNode(intval){*this.val=val;*this.left=this.right=
第六象限
·
2017-11-06 17:01
Lintcode
99 Reorder List solution 题解
【题目链接】www.
lintcode
.com/en/problem/reorder-lis
wx595c8ce565f6d
·
2017-11-05 20:40
it
lintcode
翻转二叉树
翻转二叉树描述笔记数据评测Accepted总耗时:254ms100%数据通过测试.还没解决的相关题目26%389.判断数独是否合法容易20%248.统计比给定整数小的数的个数中等19%249.统计前面比自己小的数的个数困难14%131.大楼轮廓超难26%370.将表达式转换为逆波兰表达式困难太牛了,把AC的喜悦分享给你的朋友吧!解析:这道题的树并不是二叉查找树,所以对每个结点的左右结点交换即可。/
飞翔的黄瓜
·
2017-11-02 23:17
算法
C/C++算法
lintcode
Lintcode
205 Interval Minimum Number solution 题解
【题目描述】Givenanintegerarray(indexfrom0ton-1,wherenisthesizeofthisarray),andanquerylist.Eachqueryhastwointegers[start,end].Foreachquery,calculatetheminimumnumberbetweenindexstartandendinthegivenarray,ret
程风破浪会有时
·
2017-10-30 00:16
LintCode
480-二叉树的所有路径
后序遍历非递归,当遍历到叶子结点时,将栈中所有的内容都按照格式要求生成列表返回。staticListret=newArrayListbinaryTreePaths(TreeNoderoot){//writeyourcodehereif(root==null)returnret;Stacksta=newStack"+t.val;}a+="->"+p.val;a=a.substring(2,a.len
Jason__Liang
·
2017-10-29 20:19
LintCode
Lintcode
92 Backpack solution 题解
【题目链接】www.
lintcode
.com/en/problem/backpack/【
qq59f02e228f6c7
·
2017-10-28 08:39
IT
Lintcode
91 Minimum Adjustment Cost solution 题解
【题目描述】Givenanintegerarray,adjusteachintegerssothatthedifferenceofeveryadjacentintegersarenotgreaterthanagivennumbertarget.IfthearraybeforeadjustmentisA,thearrayafteradjustmentisB,youshouldminimizethes
qq59f02e228f6c7
·
2017-10-28 08:24
it
Lintcode
91 Minimum Adjustment Cost solution 题解
【题目描述】Givenanintegerarray,adjusteachintegerssothatthedifferenceofeveryadjacentintegersarenotgreaterthanagivennumbertarget.IfthearraybeforeadjustmentisA,thearrayafteradjustmentisB,youshouldminimizethes
qq59f02e228f6c7
·
2017-10-27 23:06
it
Lintcode
89 K Sum solution 题解
【题目描述】Givenndistinctpositiveintegers,integerk(k<=n)andanumbertarget.Findknumberswheresumistarget.Calculatehowmanysolutionsthereare?给定n个不同的正整数,整数k(k<=n)以及一个目标数字。在这n个数里面找出K个数,使得这K个数的和等于目标数字,求问有多少种方案?【题目
qq59f02e228f6c7
·
2017-10-25 14:46
IT
翻转字符串(
LintCode
)
原题目地址:http://www.
lintcode
.com/zh-cn/problem/reverse-words-in-a-string/思路分析:这也是一个简单难度的题目,总体思想就是翻转每个单词,
吃青椒的小新
·
2017-10-21 11:57
LintCode
两数之和(
LintCode
)
题目来源:
LintCode
原题地址:http://www.
lintcode
.com/zh-cn/problem/two-sum/这个题目也是简单难度,我仿造网上的思路,将输入的数据用map存储(因为map
吃青椒的小新
·
2017-10-21 10:31
LintCode
Lintcode
74 First Bad Version solution 题解
【题目描述】Thecodebaseversionisanintegerstartfrom1ton.Oneday,someonecommittedabadversioninthecodecase,soitcausedthisversionandthefollowingversionsareallfailedintheunittests.Findthefirstbadversion.Youcancal
jycynb
·
2017-10-20 08:22
题解
Lintcode
72 Construct Binary Tree from Inorder and Postorder Traversal solution 题解
Youmayassumethatduplicatesdonotexistinthetree.根据中序遍历和后序遍历树构造二叉树注意:你可以假设树中不存在相同数值的节点【题目链接】http://www.
lintcode
.com
jycynb
·
2017-10-18 17:22
题解
Lintcode
71 Binary Tree Zigzag Level Order Traversal solution 题解
【题目描述】Givenabinarytree,returnthezigzaglevelordertraversalofitsnodes'values.(ie,fromlefttoright,thenrighttoleftforthenextlevelandalternatebetween).给出一棵二叉树,返回其节点值的锯齿形层次遍历(先从左往右,下一层再从右往左,层与层之间交替进行)【题目链接】
jycynb
·
2017-10-16 09:07
题解
亚马逊Amazon OA2 -
LintCode
九道题-JAVA
627.LongestPalindromeGivenastringwhichconsistsoflowercaseoruppercaseletters,findthelengthofthelongestpalindromesthatcanbebuiltwiththoseletters.求一个字符串的最长回文子串packagecom.zn.company.amazon;publicclassLong
Nicolos_Z
·
2017-10-15 14:25
亚马逊
oa
lintcode
Leetcode
Lintcode
70 Binary Tree Level Order Traversal II solution 题解
fromlefttoright,levelbylevelfromleaftoroot).给出一棵二叉树,返回其节点值从底向上的层次序遍历(按从叶节点所在层到根节点所在的层遍历,然后逐层从左往右遍历)【题目链接】www.
lintcode
.com
jycynb
·
2017-10-15 08:12
题解
Lintcode
69 Binary Tree Level Order Traversal solution 题解
(ie,fromlefttoright,levelbylevel).给出一棵二叉树,返回其节点值的层次遍历(逐层从左往右访问)【题目链接】www.
lintcode
.com/en/problem/binary-tree-level-order-traversal
jycynb
·
2017-10-14 12:49
题解
LintCode
697. Check Sum of Square Numbers
原题
LintCode
697.CheckSumofSquareNumbersDescriptionGivenaintegerc,yourtaskistodecidewhetherthere'retwointegersaandbsuchthata
Andiedie
·
2017-10-12 23:53
Maximum Subarray II(最大子数组 II)
http://www.
lintcode
.com/en/problem/maximum-subarray-ii/?
天街孤独
·
2017-10-12 19:43
Submatrix Sum(和为零的子矩阵)
http://www.
lintcode
.com/en/problem/submatrix-sum/?
天街孤独
·
2017-10-12 17:12
Lintcode
190 Next Permutation II solution 题解
【题目描述】Implementnextpermutation,whichrearrangesnumbersintothelexicographicallynextgreaterpermutationofnumbers.Ifsucharrangementisnotpossible,itmustrearrangeitasthelowestpossibleorder(ie,sortedinascendi
程风破浪会有时
·
2017-10-12 10:40
Binary Tree Maximum Path Sum(二叉树中的最大路径和)
http://www.
lintcode
.com/en/problem/binary-tree-maximum-path-sum/?
天街孤独
·
2017-10-11 23:59
Effective Java(用实例域代替序数、用EnumSet代替位域)
它的范围是常量的序数从0开始,不建议使用这个方法,因为这不能很好地对枚举进行维护,正确应该是利用实例域,例如:publicenumErrorCode{FAILURE(0),SUCCESS(1);privatefina
lintcode
一二三。
·
2017-10-11 16:47
Java
LintCode
- 插入区间(普通)
版权声明:本文为博主原创文章,未经博主允许不得转载。难度:容易要求:给出一个无重叠的按照区间起始端点排序的区间列表。在列表中插入一个新的区间,你要确保列表中的区间仍然有序且不重叠(如果有必要的话,可以合并区间)。样例插入区间[2,5]到[[1,2],[5,9]],我们得到[[1,9]]。插入区间[3,4]到[[1,2],[5,9]],我们得到**[[1,2],[3,4],[5,9]]**。思路:/
柒黍
·
2017-10-10 17:01
Permutation Index II(排列序号II)
http://www.
lintcode
.com/en/problem/permutation-index-ii/importjava.util.HashMap;importjava.util.Map;publicclassSolution
天街孤独
·
2017-10-10 08:33
Lintcode
最长单词
最长单词描述笔记数据评测给一个词典,找出其中所有最长的单词。您在真实的面试中是否遇到过这个题?Yes样例在词典{"dog","google","facebook","internationalization","blabla"}中,最长的单词集合为["internationalization"]在词典{"like","love","hate","yes"}中,最长的单词集合为["like","lo
dougan_
·
2017-10-09 21:54
Lintcode
Lintcode
合并排序数组 II
合并排序数组II描述笔记数据评测合并两个排序的整数数组A和B变成一个新的数组。注意事项你可以假设A具有足够的空间(A数组的大小大于或等于m+n)去添加B中的元素。您在真实的面试中是否遇到过这个题?Yes样例给出A=[1,2,3,empty,empty],B=[4,5]合并之后A将变成[1,2,3,4,5]publicclassSolution{/**@paramA:sortedintegerarr
dougan_
·
2017-10-06 13:48
Lintcode
Lintcode
合并排序数组
合并排序数组描述笔记数据评测合并两个排序的整数数组A和B变成一个新的数组。您在真实的面试中是否遇到过这个题?Yes样例给出A=[1,2,3,4],B=[2,4,5,6],返回[1,2,2,3,4,4,5,6]publicclassSolution{/**@paramA:sortedintegerarrayA*@paramB:sortedintegerarrayB*@return:Anewsorte
dougan_
·
2017-10-06 10:14
Lintcode
Lintcode
O(1)时间检测2的幂次
O(1)时间检测2的幂次描述笔记数据评测用O(1)时间检测整数n是否是2的幂次。您在真实的面试中是否遇到过这个题?Yes样例n=4,返回true;n=5,返回false.注意:判断是否为2的幂次的方法是n&(n-1),因为2的幂次的二进制表示为1后面接很多零,而减去1后为0后面接很多1,按位与后就全为0了。publicclassSolution{/**@paramn:Aninteger*@retu
dougan_
·
2017-10-05 15:28
Lintcode
Lintcode
移动零
移动零描述笔记数据评测给一个数组nums写一个函数将0移动到数组的最后面,非零元素保持原数组的顺序注意事项1.必须在原数组上操作2.最小化操作数您在真实的面试中是否遇到过这个题?Yes样例给出nums=[0,1,0,3,12],调用函数之后,nums=[1,3,12,0,0].publicclassSolution{/**@paramnums:anintegerarray*@return:*/pu
dougan_
·
2017-10-05 12:27
Lintcode
Lintcode
搜索插入位置
搜索插入位置描述笔记数据评测给定一个排序数组和一个目标值,如果在数组中找到目标值则返回索引。如果没有,返回到它将会被按顺序插入的位置。你可以假设在数组中无重复元素。您在真实的面试中是否遇到过这个题?Yes样例[1,3,5,6],5→2[1,3,5,6],2→1[1,3,5,6],7→4[1,3,5,6],0→0publicclassSolution{/**@paramA:anintegersort
dougan_
·
2017-10-05 12:43
Lintcode
Interval Sum II(区间求和 II)
http://www.
lintcode
.com/en/problem/interval-sum-ii/请参阅SegmentTreeBuildII(线段树的构造II)SegmentTreeQueryII(
天街孤独
·
2017-10-02 08:55
Lintcode
反转整数
反转整数描述笔记数据评测将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回0(标记为32位整数)。您在真实的面试中是否遇到过这个题?Yes样例给定x=123,返回321给定x=-123,返回-321publicclassSolution{/**@paramn:theintegertobereversed*@return:thereversedinteger*/publicintreverseI
dougan_
·
2017-09-30 17:03
Lintcode
Number of Big Islands
http://www.
lintcode
.com/zh-cn/problem/number-of-big-islands/请参阅NumberofIslands(岛屿的个数)publicclassSolution
天街孤独
·
2017-09-29 22:47
Paint Fence(栅栏染色)
http://www.
lintcode
.com/en/problem/paint-fence/publicclassSolution{/**@paramn:non-negativeinteger,nposts
天街孤独
·
2017-09-29 22:53
Flip Bits(将整数A转换为B)
http://www.
lintcode
.com/en/problem/flip-bits/classSolution{/***@parama,b:Twointeger*return:Aninteger*
天街孤独
·
2017-09-29 22:12
Lintcode
字符串置换
字符串置换描述笔记数据评测给定两个字符串,请设计一个方法来判定其中一个字符串是否为另一个字符串的置换。置换的意思是,通过改变顺序可以使得两个字符串相等。您在真实的面试中是否遇到过这个题?Yes样例"abc"为"cba"的置换。"aabc"不是"abcc"的置换。publicclassSolution{/**@paramA:astring*@paramB:astring*@return:aboole
dougan_
·
2017-09-29 13:51
Lintcode
Lintcode
奇偶分割数组
奇偶分割数组描述笔记数据评测分割一个整数数组,使得奇数在前偶数在后。您在真实的面试中是否遇到过这个题?Yes样例给定[1,2,3,4],返回[1,3,2,4]。挑战在原数组中完成,不使用额外空间。publicclassSolution{/**@paramnums:anarrayofintegers*@return:nothing*/publicvoidpartitionArray(int[]num
dougan_
·
2017-09-28 18:29
Lintcode
Mock Hanoi Tower by Stacks(用栈模拟汉诺塔问题)
http://www.
lintcode
.com/en/problem/mock-hanoi-tower-by-stacks/publicclassTower{privateStackdisks;//createthreetowers
天街孤独
·
2017-09-28 00:09
Lintcode
183 Wood Cut solution 题解
【题目描述】GivennpiecesofwoodwithlengthL[i](integerarray).Cutthemintosmallpiecestoguaranteeyoucouldhaveequalormorethankpieceswiththesamelength.Whatisthelongestlengthyoucangetfromthenpiecesofwood?GivenL&k,r
程风破浪会有时
·
2017-09-27 13:00
Route Between Two Nodes in Graph(图中两个点之间的路线)
http://www.
lintcode
.com/en/problem/route-between-two-nodes-in-graph/?
天街孤独
·
2017-09-27 00:05
上一页
60
61
62
63
64
65
66
67
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他