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
- 将二叉树拆成链表(普通)
版权声明:本文为博主原创文章,未经博主允许不得转载。难度:容易要求:将一棵二叉树按照前序遍历拆解成为一个假链表。所谓的假链表是说,用二叉树的right指针,来表示链表中的next指针。注意事项不要忘记将左儿子标记为null,否则你可能会得到空间溢出或是时间溢出。样例1\12/\\25=>3/\\\3464\5\6思路:/***@paramroot:aTreeNode,therootofthebin
柒黍
·
2021-04-25 21:58
lintcode
-回文链表
设计一种方式检查一个链表是否为回文链表。再用原地反转解决一次/***Definitionforsingly-linkedlist.*structListNode{*intval;*ListNode*next;*ListNode(intx):val(x),next(NULL){}*};*/classSolution{public:/***@paramheadaListNode*@returnaboo
鬼谷神奇
·
2021-04-25 09:41
OJ:
lintcode
在O(1)时间复杂度删除链表节点
给定一个单链表中的一个等待被删除的节点(非表头或表尾)。请在在O(1)时间复杂度删除该链表节点。您在真实的面试中是否遇到过这个题?Yes样例给定1->2->3->4,和节点3,删除3之后,链表应该变为1->2->4。/***DefinitionofListNode*classListNode{*public:*intval;*ListNode*next;*ListNode(intval){*thi
DayDayUpppppp
·
2021-04-25 05:01
LintCode
- 恢复旋转排序数组(普通)
版权声明:本文为博主原创文章,未经博主允许不得转载。难度:容易要求:给定一个旋转排序数组,在原地恢复其排序。说明什么是旋转数组?比如,原始数组为[1,2,3,4],则其旋转数组可以是[1,2,3,4],[2,3,4,1],[3,4,1,2],[4,1,2,3]样例[4,5,1,2,3]->[1,2,3,4,5]思路:publicclassSolution{/***@paramnums:Therot
柒黍
·
2021-04-24 23:41
Lintcode
54 String to Integer II solution 题解
【题目描述】Implementfunctionatoitoconvertastringtoaninteger.Ifnovalidconversioncouldbeperformed,azerovalueisreturned.Ifthecorrectvalueisoutoftherangeofrepresentablevalues,INT_MAX(2147483647)orINT_MIN(-2147
代码码着玩
·
2021-04-24 09:40
LintCode
140-快速幂
分析注意溢出classSolution{public:/**@parama,b,n:32bitintegers*@return:Aninteger*/intfastPower(inta,intb,intn){//writeyourcodeherereturndfs(a%b,b,n);}longlongdfs(inta,intb,intn){if(!n)return1%b;intr=n/2;long
胡哈哈哈
·
2021-04-23 21:44
Lintcode
391 Number of Airplanes in the Sky solution 题解
【题目描述】Givenanintervallistwhichareflyingandlandingtimeoftheflight.Howmanyairplanesareontheskyatmost?Notice:Iflandingandflyinghappensatthesametime,weconsiderlandingshouldhappenatfirst.给出飞机的起飞和降落时间的列表,用i
程风破浪会有时
·
2021-04-23 02:02
lintcode
二叉查找树中搜索区间
给定两个值k1和k2(k1val=val;*this->left=this->right=NULL;*}*}*/classSolution{public:/***@paramroot:Therootofthebinarysearchtree.*@paramk1andk2:rangek1tok2.*@return:Returnallkeysthatk1searchRange(TreeNode*roo
yzawyx0220
·
2021-04-22 07:24
Majority Number III
MajorityNumberIII今天是一道数学计算的题目,来自
LintCode
,在
LintCode
的Ladder中被归为Greedy算法一类。难度为Medium,Acceptance为26%。
ab409
·
2021-04-21 05:17
LintCode
369 [Convert Expression to Polish Notation]
原题给定一个表达式字符串数组,返回该表达式的波兰表达式。(即去掉括号)对于[(5−6)*7]的表达式(该表达式可表示为["(","5","−","6",")","","7"]),其对应的波兰表达式为[-567](其返回的数值为["*","−","5","6","7"])。解题思路首先建立表达式树,如题[ExpressionTreeBuild]PolishNotation即表达式树前序遍历的结果完整
Jason_Yuan
·
2021-04-20 23:06
LintCode
寻找峰值
题目你给出一个整数数组(size为n),其具有以下特点:相邻位置的数字是不同的A[0]A[n-1]假定P是峰值的位置则满足A[P]>A[P-1]且A[P]>A[P+1],返回数组中任意一个峰值的位置。注意事项数组可能包含多个峰值,只需找到其中的任何一个即可样例给出数组[1,2,1,3,4,5,7,6]返回1,即数值2所在位置,或者6,即数值7所在位置.分析二分法搜索代码classSolution{
六尺帐篷
·
2021-04-20 17:14
Lintcode
422 Length of Last Word solution 题解
【题目描述】Givenastringsconsistsofupper/lower-casealphabetsandemptyspacecharacters'',returnthelengthoflastwordinthestring.Ifthelastworddoesnotexist,return0.NoticeAwordisdefinedasacharactersequenceconsistso
程风破浪会有时
·
2021-04-20 05:50
统计数字(
lintcode
)
题目:计算数字k在0到n中的出现的次数,k可能是0~9的一个值样例:例如n=12,k=1,在[0,1,2,3,4,5,6,7,8,9,10,11,12],我们发现1出现了5次(1,10,11,12)思路:对于数字n,k的出现次数=当n的个(十百千万...)位为2其他位数的全排列数量的总和.例如数字为n=302,k=2那么在n中k出现的次数=2**全排列数量+*2*全排列数量+**2全排列数量,对于
剑戈2
·
2021-04-17 15:58
[动态规划](烦人的背包)背包问题
文章目录背包问题:思路:动态规划:代码:代码优化:[背包问题II](https://www.
lintcode
.com/problem/125/)思路:代码[背包问题III](https://www.
lintcode
.com
@书生
·
2021-04-16 12:43
代码练习
动态规划
算法
[
LintCode
][System Design] Inverted Index
ProblemCreateaninvertedindexwithgivendocuments.ExampleGivenalistofdocumentswithidandcontent.(classDocument)[{"id":1,"content":"Thisisthecontentofdocument1,it'sveryshort"},{"id":2,"content":"Thisisthec
楷书
·
2021-04-14 01:04
不会【1错-1】通配符匹配
https://www.
lintcode
.com/problem/wildcard-matching/description?
7ccc099f4608
·
2021-03-17 09:46
Lintcode
105 Copy List with Random Pointer solution 题解
【题目描述】Alinkedlistisgivensuchthateachnodecontainsanadditionalrandompointerwhichcouldpointtoanynodeinthelistornull.Returnadeepcopyofthelist.给出一个链表,每个节点包含一个额外增加的随机指针可以指向链表中的任何节点或空的节点。返回一个深拷贝的链表。【题目链接】www
草珊瑚_6557
·
2021-03-11 16:52
OJ
Lintcode
子数组之和
给定一个整数数组,找到和为零的子数组。你的代码应该返回满足要求的子数组的起始位置和结束位置注意事项Thereisatleastonesubarraythatit'ssumequalstozero.您在真实的面试中是否遇到过这个题?Yes样例给出[-3,1,2,-3,4],返回[0,2]或者[1,3].classSolution{public:/***@paramnums:Alistofintege
DayDayUpppppp
·
2021-03-11 07:39
python反转一个三位整数的多种实现方案
在
LintCode
上练习遇到这个问题,查阅资料找到多种方法,总结如下。
·
2021-03-10 22:21
466. Count Linked List Nodes
[http://www.
lintcode
.com/en/problem/count-linked-list-nodes/]#Python"""DefinitionofListNodeclassListNode
fdgump
·
2021-03-10 16:31
数字配对 - [Python3]
数字配对-[Python3]数字配对是由
LintCode
(详见
LintCode
介绍)题目描述给出一个数组nums,将数组中的数两两配对。令数组sums为配对后每组数字的和,要求sums的极差最小。
无限的菜鸟
·
2021-02-14 20:52
python
算法
leetcode
山羊拉丁文 - [Python3]
山羊拉丁文-[Python3]山羊拉丁文(这是个很奇怪的名字)是由
LintCode
(详见
LintCode
介绍)提供的一道简单级别的面试题,接下来我对Python3的实现做以简单解释。
无限的菜鸟
·
2021-02-14 17:12
python
字符串
自然语言处理
经验分享
CAT专属题--合法标识符 [Python3]
CAT专属题–合法标识符[Python3]合法标识符是
LintCode
(详见
LintCode
介绍)所提供的一道CAT评测专属题目,现在我对Python3的实现做以简单分析,如有不妥之处,欢迎指正。
无限的菜鸟
·
2021-02-09 20:39
字符串
python
列表
双端队列 [Python3]
双端队列[Python3]双端队列是
LintCode
(详见
LintCode
介绍)所提供的一道简单级别的面试题,现在我对Python3的实现做以简单分析,如有不妥之处,欢迎指正。
无限的菜鸟
·
2021-02-06 11:29
队列
python
算法
丢鸡蛋 [Python3]
丢鸡蛋[Python3]'丢鸡蛋’是
LintCode
(详见
LintCode
介绍)所提供的一道简单级别的面试题,现在我对Python3的实现做以简单分析,如有不妥之处,欢迎指正。
无限的菜鸟
·
2021-02-04 12:43
python
算法
面试
识别字符串 [Python3]
识别字符串[Python3]识别字符串是
LintCode
(详见
LintCode
介绍)所提供的一道简单级别的面试题,现在我对Python3的实现做以简单分析,如有不妥之处,欢迎指正。
无限的菜鸟
·
2021-02-04 12:36
字符串
python
算法
从不充值的玩家 SQL查询
从不充值的玩家从不充值的玩家是
LintCode
(见
LintCode
介绍)提供的一道入门级数据库面试题,接下来对其进行简单分析。
无限的菜鸟
·
2021-02-02 13:10
sql
数据库
LintCode
介绍
第一次在CSDN上发布文章作为一名代码小白,有幸来到CSDN进行学习,同时也是很幸运地被介绍了
LintCode
并且在其中练习各类算法题目,我将在CSDN中分享在
LintCode
中的经历,希望有大佬多带带我
无限的菜鸟
·
2021-01-31 20:03
经验分享
python
c++
java
Lintcode
二分法题目刷题总结-使用python语言-参考九章算法课程配套习题,由易到难,梯度设置合理
458.目标最后位置给一个升序数组,找到target最后一次出现的位置,如果没出现过返回-1样例1:输入:nums=[1,2,2,4,5,5],target=2输出:2样例2:输入:nums=[1,2,2,4,5,5],target=6输出:-1classSolution:"""@paramnums:Anintegerarraysortedinascendingorder@paramtarget:
林风风
·
2021-01-18 23:26
Coding练习
python
算法
二分法
【刷题打卡】day11-二叉树
题库:
lintcode
有些题目链接打不开,需要权限,那大家就去九章算法参考答案里找找。
banban008
·
2021-01-15 08:23
算法
二分法
算法
二叉树
数据结构
【
Lintcode
】1075. Subarray Product Less Than K
题目地址:https://www.
lintcode
.com/problem/subarray-product-less-than-k/description给定一个长nnn数组AAA,问其有多少个子数组之乘积小于一个给定数
记录算法
·
2021-01-03 09:26
#
数组
链表与模拟
指针
leetcode
算法
【
Lintcode
】1322. Product Equal B
题目地址:https://www.
lintcode
.com/problem/product-equal-b/description给定一个长nnn数组AAA,再给定一个数bbb,每次可以花费111的代价将序列中的某个数加
记录算法
·
2021-01-03 07:01
#
贪心
动态规划与记忆化搜索
数据结构
java
动态规划
算法
leetcode
【
Lintcode
】1736. Throw Garbage
题目地址:https://www.
lintcode
.com/problem/throw-garbage/description给定一个浮点型长nnn数组AAA,题目保证每个数的范围是[1.01,3.00
记录算法
·
2021-01-03 03:59
#
贪心
动态规划与记忆化搜索
算法
java
leetcode
【
Lintcode
】1877. Longest Super Sequence
题目地址:https://www.
lintcode
.com/problem/longest-super-sequence/description给定一个长nnn数组AAA,要求找到其最长子数组,删掉其一个元素之后别的元素出现次数都一样
记录算法
·
2021-01-03 01:13
#
树
分治与堆
leetcode
算法
java
数据结构
【
Lintcode
】1119. Maximum Product of Three Numbers
题目地址:https://www.
lintcode
.com/problem/maximum-product-of-three-numbers/description给定一个长nnn的数组AAA,取其中三个数使得乘积最大
记录算法
·
2021-01-01 00:19
#
二分
位运算与数学
leetcode
数据结构
算法
《学Unity的猫》——第十八集:Unity3D游戏开发工程师笔试刷题,皮皮收到面试邀请
文章目录18.1皮皮收到面试邀请18.2面试题库相关网站18.2.1牛客网18.2.2领扣
LintCode
18.2.3力扣LeetCode18.3优质学习网站18.3.1菜鸟教程18.3.2W3CSCHOOL18.3.3BiliBili18.3.4
林新发
·
2020-12-28 17:55
Unity游戏开发
Unity3D
学Unity的猫
面试
刷题
笔试
Unity
【
Lintcode
】660. Read N Characters Given Read4 II - Call Multiple Times
题目地址:https://www.
lintcode
.com/problem/read-n-characters-given-read4-ii-call-multiple-times/description
记录算法
·
2020-11-05 00:58
LC
栈
队列
串及其他数据结构
队列
指针
java
数据结构
解决vue在webstrom中的代码格式化问题
解决办法一:编辑器打开文件首先,在编辑器里面要启用eslint插件在.eslintrc.js上右键,菜单底部有一个“ApplyES
LintCode
StyleRule”点它,之后自动格式化就会
plan_ b
·
2020-11-03 10:07
vue框架学习和项目常见问题
vue
【
Lintcode
】1582. Minimum Path Sum II
题目地址:https://www.
lintcode
.com/problem/minimum-path-sum-ii/description给定一个二维矩阵AAA,求从左下角到右上角的所有路径中权值和最小的路径
记录算法
·
2020-10-31 00:32
LC
DFS
BFS与图论
算法
java
数据结构
leetcode
LintCode
-655.Big Integer Addition
题目描述Giventwonon-negativeintegersnum1andnum2representedasstring,returnthesumofnum1andnum2.样例Givennum1="123",num2="45"return"168"解答思路注意:从右往左计算作为字符串的结果要转置代码publicclassSolution{/***@paramnum1anon-negative
悠扬前奏
·
2020-10-10 23:28
Lintcode
405 Submatrix Sum solution 题解
【题目描述】Givenanintegermatrix,findasubmatrixwherethesumofnumbersiszero.Yourcodeshouldreturnthecoordinateoftheleft-upandright-downnumber.给定一个整数矩阵,请找出一个子矩阵,使得其数字之和等于0.输出答案时,请返回左上数字和右下数字的坐标。【题目链接】www.lintco
程风破浪会有时
·
2020-10-10 16:04
数据结构与算法/leetcode/
lintcode
题解
参考链接数据结构与算法/leetcode/
lintcode
题解深度好文-数据结构可视化-惊呆了
矮油不错哦_ab60
·
2020-10-10 14:40
Lintcode
430 Scramble String solution 题解
【题目描述】Givenastrings1,wemayrepresentitasabinarytreebypartitioningittotwonon-emptysubstringsrecursively.Belowisonepossiblerepresentationofs1="great":great/\great/\/\great/\atToscramblethestring,wemaycho
程风破浪会有时
·
2020-10-10 10:31
LintCode
309. 交叉数组 JavaScript算法
描述Giventwoarraysofthesamelength,interleavethembytakingthefirstelementofthefirstone,thefirstelementofthesecondone,thesecondelementofthefirstarrayandsoonforallelementofthearrays.Returnthenewinterleaveda
SmallTeddy
·
2020-10-09 10:55
LintCode
算法
数据结构
javascript
python
leetcode
LintCode
278. 绘制填充 JavaScript算法
描述实现可以在许多图像编辑程序中看到的“绘制填充”功能。也就是说,给定屏幕(由二维颜色阵列表示),一个点和新的颜色,填充指定点周围与起始颜色相同的点,直到颜色全部变为新颜色。说明颜色的种类是在[1,5]这个区间内的整数点周围区域是指上下左右样例-样例1:输入:screen=[[2,2,5],[1,3,3]],x=1,y=1,newColor=4输出:true解释:给定的点的位置的新的颜色与旧颜色不
SmallTeddy
·
2020-10-09 09:28
LintCode
python
java
算法
javascript
js
LintCode
213. 字符串压缩 JavaScript算法
描述设计一种方法,通过给重复字符计数来进行基本的字符串压缩。例如,字符串aabcccccaaa可压缩为a2b1c5a3。而如果压缩后的字符数不小于原始的字符数,则返回原始的字符串。可以假设字符串仅包括a-z的字母。样例-样例1:输入:str="aabcccccaaa"输出:"a2b1c5a3"-样例2:输入:str="aabbcc"输出:"aabbcc"解析constcompress=functi
SmallTeddy
·
2020-10-09 09:00
LintCode
字符串
python
算法
js
leetcode
LintCode
1201. 下一个更大的数 II JavaScript算法
描述给定一个环形数组(最后一个元素的下一个元素是数组的第一个元素),为每个元素打印下一个更大的元素。数字x的下一个更大的数是数组中下一个遍历顺序中出现的第一个更大的数字,这意味着您可以循环搜索以查找其下一个更大的数字。如果它不存在,则为此数字输出-1。说明给定数组的长度不超过10000。样例-例1:输入:[1,2,1]输出:[2,-1,2]解释:第一个1的下一个更大的数字是2;数字2找不到下一个更
SmallTeddy
·
2020-09-17 09:45
LintCode
算法
数据结构
leetcode
java
python
381. 螺旋矩阵 II
题目链接:https://www.
lintcode
.com/problem/spiral-matrix-ii/description给定一个数n,生成一个包含1~n^2n2的螺旋形矩阵.
mysteryflower
·
2020-09-17 05:52
LintCode刷题
Android语音识别DEMO
publicclassVoiceActivityextendsActivityimplementsOnClickListener{privatestaticfina
lintCODE
=11;privateButtonvoice_btn
事在人为,幸福从不抱怨开始!
·
2020-09-16 23:24
安卓学习
【
LintCode
】数组划分
描述给出一个整数数组nums和一个整数k。划分数组(即移动数组nums中的元素),使得:所有小于k的元素移到左边所有大于等于k的元素移到右边返回数组划分的位置,即数组中第一个位置i,满足nums[i]大于等于k。pythoncodeclassSolution:"""@paramnums:Theintegerarrayyoushouldpartition@paramk:Asdescription@r
tzshlyt
·
2020-09-16 19:52
数据结构与算法
上一页
7
8
9
10
11
12
13
14
下一页
按字母分类:
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
其他