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
solution
回溯算法之子集问题 leetxode子集问题78,90,491
回溯算法几种问题的复杂度分析-知乎class
Solution
{List>res=newArrayListpath=newLinkedList>subsets(int[]nums){this.nums=nums
小白师弟学java
·
2023-12-19 16:43
数据结构与算法
算法
leetcode
数据结构
java
回溯算法之分割问题 leetcode分割回文串、复原ip地址
class
Solution
{List>res=newArrayListpath=newArrayList>partition(Strings){
小白师弟学java
·
2023-12-19 16:13
数据结构与算法
leetcode
算法
数据结构
java
动态规划算法入门之爬楼梯系列
目录509.斐波那契数70.爬楼梯746.最小花费爬楼梯爬楼梯PLUS509.斐波那契数思路:递归可以直接秒,但时间复杂度是O(2^n),动态规划迭代只用O(n)class
Solution
{publicintfib
小白师弟学java
·
2023-12-19 16:43
数据结构与算法
leetcode
算法
数据结构
动态规划
java
JVM-10-类加载
一个类型从被加载到虚拟机内存中开始,到卸载出内存为止,它的整个生命周期将会经历加载(Loading)、验证(Verification)、准备(Preparation)、解析(Re
solution
)、初始化
Andy.88666
·
2023-12-19 16:40
JVM
jvm
289. 生命游戏
class
Solution
{publicvoidgameOfLife(int[][]board){intm=board.length,n=board[
cccc楚染rrrr
·
2023-12-19 16:00
LeetCode
算法
数据结构
54. 螺旋矩阵
设置上下左右四个边界class
Solution
{publicListspiralOrder(int[][]matrix){Listans=newArrayList=jbg;--j){ans.add(matrix
cccc楚染rrrr
·
2023-12-19 16:30
LeetCode
矩阵
算法
线性代数
73. 矩阵置零
可以选择遍历两遍matrix,一遍记录哪些行哪些列需要置0,一遍置0O(1)空间复杂度的做法:首先设置两个boolean型变量记录第0行和第0列是否需要置0然后用第0行和第0列记录需要置0的行和列class
Solution
cccc楚染rrrr
·
2023-12-19 16:59
LeetCode
矩阵
算法
数据结构
LeetCode 162. 寻找峰值
2、接口描述class
Solution
{public:intfindPeakElement(vector&num
EQUINOX1
·
2023-12-19 15:42
leetcode每日一题
算法
c++
leetcode
开发语言
数据结构
LeetCode 1901. 寻找峰值 II
要求必须写出时间复杂度为O(mlog(n))或O(nlog(m))的算法2、接口描述class
Solution
{public:
EQUINOX1
·
2023-12-19 15:10
leetcode每日一题
算法
c++
数据结构
leetcode
职场和发展
LeetCode Hot100 239.滑动窗口最大值
思路:代码:class
Solution
{publicint[]maxSlidingWindow(int[]nums,intk){intn=nums.length;int[]ans=newint[n-k+
hn小菜鸡
·
2023-12-19 14:30
算法刷题-滑动窗口
算法刷题-子串
leetcode
算法
数据结构
LeetCode Hot100 76.最小覆盖子串
代码:class
Solution
{//建立两个HashMap,ori用于存储目标字符串t中每个字符的出现次数//cnt用于存储当前窗口中每个字符
hn小菜鸡
·
2023-12-19 14:58
算法刷题-子串
leetcode
算法
职场和发展
跳跃游戏系列总结
class
Solution
{publicbooleancanJump(int[]nums){//能跳到的位置一定是连续的一段//j标记当前能跳到的最大下标for(inti=0,j=0;i&nums){i
huaiyingdetective
·
2023-12-19 14:52
游戏
算法
leetcode
Leetcode—1901.寻找峰值II【中等】
2023每日刷题(六十四)Leetcode—1901.寻找峰值II实现代码class
Solution
{public:intindexofMax(vector&arr){returnmax_element
源代码•宸
·
2023-12-19 14:11
LeetCode刷题
leetcode
算法
职场和发展
c++
经验分享
二分查找
Leetcode—12.整数转罗马数字【中等】
,{400,"CD"},{100,"C"},{90,"XC"},{50,"L"},{40,"XL"},{10,"X"},{9,"IX"},{5,"V"},{4,"IV"},{1,"I"}};class
Solution
源代码•宸
·
2023-12-19 14:11
LeetCode刷题
leetcode
linux
算法
c++
经验分享
哈希表
做题总结 142. 环形链表 II
publicclass
Solution
{publicList
aPurpleBerry
·
2023-12-19 14:06
LeetCode做题总结
leetcode
752. Open the Lock
class
Solution
{publicintopenLock(String[]deadends,Stringtarget){Setvisited=newHashSetdead=newHashSetqueue
尚无花名
·
2023-12-19 13:04
高频算法题 —— 检测循环依赖(拓扑排序)
检测循环依赖介绍检测循环依赖本质就是使用拓扑排序判断图中是否有环、给出拓扑排序的结果详情请移步检测循环依赖LeetCode207.课程表题目链接class
Solution
:defcanFinish(self
夏木夕
·
2023-12-19 12:35
#
LeetCode
算法
leetcode
python旋转矩阵
顺时针旋转,先将矩阵倒序,再转置class
Solution
:defrotate(self,matrix:List[List[int]])->None:matrix[::]=[[row[i]forrowinmatrix
单单一个越字
·
2023-12-19 11:11
python
算法
力扣每日一题:162. 寻找峰值(2023-12-18)
力扣每日一题题目:162.寻找峰值日期:2023-12-18用时:10m9s时间:0ms内存:40.54MB代码:class
Solution
{publicintfindPeakElement(int[]
轩辕龙儿
·
2023-12-19 11:27
力扣每日一题
leetcode
算法
数据结构
【Leetcode】Reverse Bits
Reversebitsofagiven32bitsunsignedinteger.class
Solution
:#@paramn,aninteger#@returnanintegerdefreverseBits
云端漫步_b5aa
·
2023-12-19 11:37
排列问题 全排列I 全排列II
class
Solution
{List>res=newArrayList>combine(intn,intk){if(kpath=newArrayDequepath){//递归终止条件是:path的长度等于
trigger333
·
2023-12-19 09:02
四大件之数据结构和算法
回溯问题
深度优先
java
算法
LeetCode 47.全排列Ⅱ
重点在于有重复数字如何避免重复的排列组合先对数组进行排序在递归选取数字时如果有重复数字规定必须从前往后依次选取不能跳过前面的数字选取后面的数字用一个数组记录nums数组中某个数字是否已经被选取class
Solution
零一熊
·
2023-12-19 09:02
LeetCode
leetcode
java
dfs
【经典LeetCode算法题目专栏分类】【第6期】二分查找系列:x的平方根、有效完全平方数、搜索二位矩阵、寻找旋转排序数组最小值
X的平方根class
Solution
:defmySqrt(self,x:int)->int:l,r,ans=0,x,-1whilelbool:l=0r=numwhilelint:ifnotnums:retur
阿_旭
·
2023-12-19 09:01
算法与数据结构
算法
leetcode
二分查找
46. 全排列
class
Solution
{public:voiddfs(vector&nums){if(tmp.size()==nums.size()){res.push_back(tmp);return;}for(
baixiaofei567
·
2023-12-19 09:58
#
回溯算法
leetcode
算法
dfs
leetcode
【重点】【回溯】【DFS】79.单词搜索
class
Solution
{publicbooleanexist(char[][]board,Stringword){char[]charArr=word.toCharArray();intm=board.length
Allenlzcoder
·
2023-12-19 09:27
力扣Top100
深度优先
回溯
【回溯】【DFS】51.N皇后
题目class
Solution
{publicList>solveNQueens(intn){List>res=newArrayList>res){intn=tmp.length;if(layer==n)
Allenlzcoder
·
2023-12-19 09:27
力扣Top100
深度优先
N皇后
【数字全排列】LeetCode 46. Permutations
LeetCode46.Permutations
Solution
0:补充一个偷鸡摸狗的方法。
Allenlzcoder
·
2023-12-19 09:27
LeetCode练习题
leetcode
Permutations
【重点】【DFS】22.括号生成
class
Solution
{publicListgenerateParenthesis(intn){Listres=newArrayListres){if(lefttmp.length/2||right
Allenlzcoder
·
2023-12-19 09:56
力扣Top100
深度优先
括号生成
【经典LeetCode算法题目专栏分类】【第5期】贪心算法:分发饼干、跳跃游戏、模拟行走机器人
分发饼干class
Solution
:deffindContentChildren(self,g:List[int],s:List[int])->int:#贪心算法res=0g.sort()s.sort(
阿_旭
·
2023-12-19 09:55
算法与数据结构
贪心算法
Leetcode
【重点】【DFS】【排列】46.全排列
题目跟另外一个题目很像:字符串的排列法1:DFS,最佳解法class
Solution
{publicList>permute(int[]nums){List>res=newArrayList>res){if
Allenlzcoder
·
2023-12-19 09:24
力扣Top100
深度优先
全排列
day35 算法训练|贪心算法 part04
因为5既可以用来找10还可以用来找20,但是10只能用来找20class
Solution
{publicbooleanlemonadeChange(int[]bills){intfive=0;int
AdrianLeon
·
2023-12-19 08:09
贪心算法
算法
[23] 4K4D: Real-Time 4D View Synthesis at 4K Re
solution
paper|proj|code提出一种基于K-Planes的4DpointcloudRepresentation;提出一种Hybridappearancemodel,包含imageblendingmodel和SHmodel。其中,imageblendingmodel将3D点映射回原图中求得,SHmodel通过模型预测求得。提出一种可导的深度排序算法,训练时通过Pytorch计算,渲染时通过Open
zzl_1998
·
2023-12-19 06:56
人工智能
4K4D
4D
NeRF
118. 杨辉三角
题目:LeetCode118.杨辉三角:118.杨辉三角分析:这道题用二维数组来做.解析:class
Solution
{publicList>generate(intnumRows){List>list=
踏遍三十六岸
·
2023-12-19 06:32
算法
数据结构
leetcode
java
119. 杨辉三角 II
在「杨辉三角」中,每个数是它左上方和右上方的数的和题目:LeetCode119.杨辉三角II:119.杨辉三角II分析:这道题用二维数组来做.解析:class
Solution
{publicListgetRow
踏遍三十六岸
·
2023-12-19 06:57
算法
数据结构
leetcode
java
819. 最常见的单词
819.最常见的单词Java:split()过滤class
Solution
{publicStringmostCommonWord(Stringparagraph,String[]banned){Strings
LIZHUOLONG1
·
2023-12-19 05:12
LeetCode刷题
算法
559. N 叉树的最大深度
class
Solution
{publicintmaxDepth(Noderoot){if(root==null){return0;}intmaxChildDepth=0;Listchildren=root.children
LIZHUOLONG1
·
2023-12-19 05:42
LeetCode刷题
算法
589. N 叉树的前序遍历
589.N叉树的前序遍历java1:stack栈:没看懂class
Solution
{publicListpreorder(Noderoot){Listres=newArrayList();if(root
LIZHUOLONG1
·
2023-12-19 05:42
LeetCode刷题
深度优先
算法
1796. 字符串中第二大的数字
1796.字符串中第二大的数字java:class
Solution
{publicintsecondHighest(Strings){intmax=-1;for(charch:s.toCharArray(
LIZHUOLONG1
·
2023-12-19 05:39
LeetCode刷题
算法
python实现leetcode之152. 乘积最大子数组
解题思路一遍扫描152.乘积最大子数组代码class
Solution
:defmaxProduct(self,nums:List[int])->int:mx=mi=ans=nums[0]foriinrange
深圳都这么冷
·
2023-12-19 05:14
Leetcode 811. Subdomain Visit Count
文章作者:Tyan博客:noahsnail.com|CSDN|1.DescriptionSubdomainVisitCount2.
Solution
Version1class
Solution
:defsubdomainVisits
SnailTyan
·
2023-12-19 05:06
【力扣100】【好题】148.排序链表
#classListNode:#def__init__(self,val=0,next=None):#self.val=val#self.next=nextclass
Solution
:defsortList
红水母
·
2023-12-19 05:12
leetcode
链表
算法
【力扣100】【好题】23.合并k个升序链表
#classListNode:#def__init__(self,val=0,next=None):#self.val=val#self.next=nextclass
Solution
:#21.合并两个有序链表
红水母
·
2023-12-19 05:12
leetcode
链表
python
【力扣100】206.反转链表
#classListNode:#def__init__(self,val=0,next=None):#self.val=val#self.next=nextclass
Solution
:defreverseList
红水母
·
2023-12-19 05:39
leetcode
链表
算法
一段代码 + 一张图 = 60天的坚持和总结(卡哥:弯路消失者)
fundamentals=0whileTrue:error=grindLeetCode(fundamentals)fundamentals=learnFrom
Solution
s(error)iffundamentals
Fai_B
·
2023-12-19 04:00
leetcode
python
leetcode1301 最大得分的路径数目
代码class
Solution
{public:vectorpathsWithMaxScore(vector&board){if(board.empty()){returnvector(2,0);}introw
奥利奥蘸墨水
·
2023-12-19 03:43
ug871 Lab2
实验平台VitisHLS2021.2Windows10实验内容如何基于现有VivadoHLS项目创建Tcl命令文件并使用Tcl接口实验步骤Step1:创建Tcl文件将fir_prj\
solution
1\
伏羲天源
·
2023-12-19 03:21
#
FPGA
fpga
Count of Smaller Numbers After Self
Youaregivenanintegerarraynumsandyouhavetoreturnanewcountsarray.Thecountsarrayhasthepropertywherecounts[i]isthenumberofsmallerelementstotherightofnums[i].答案错误的答案(未考虑duplicateelements的情况)class
Solution
BLUE_fdf9
·
2023-12-19 02:27
容斥原理的并
文章目录简介AcWing890.能被整除的数思路解析CODE简介推荐题解:https://www.acwing.com/
solution
/content/126553/画了图,清晰易懂,懒得打字了。
2301_78981471
·
2023-12-19 02:34
算法学习记录
笔记
算法
c++
LeetCode5.最长回文子串
面试官让他优化他没优化出来,这道题我之前没写过,我就想看看我能不能用效率高一点的方法把它做出来,我一开始就在想用递归或者翻转字符串等等技巧,想了半个多小时都想不到,然后算了,我也用暴力法吧,然后就写了如下代码:class
Solution
荔枝味啊~
·
2023-12-19 01:49
leetcode
算法
leetcode
java
LeetCode124.二叉树中最大路径和
以下是我的代码:class
Solution
{intmax;publicintmaxPathSum(TreeNoderoot){max=Integer.MIN_VALUE;returndfs2(root)
荔枝味啊~
·
2023-12-19 01:19
leetcode
深度优先
算法
leetcode
java
上一页
99
100
101
102
103
104
105
106
下一页
按字母分类:
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
其他