LeetCode Algorithm Menu (算法目录)

数学基础 - 矩阵的基本运算(Matrix Operations) 矩阵的基本运算(Matrix Operations) 三个初等行(列)变换 加法(Plus) 乘法(Multiply) 与数的乘法 与矩阵的乘法 转置(Transpose) 方阵的行列式(Determinant) 克莱默法则(Cramer) 雅可比行列式(Jacobi) 逆(Inverse) 秩(Rank) 迹(Trace) 矩阵的基本运算(Matrix Operati... 阅读详情

LeetCode Algorithm Menu (算法目录)

这个目录是记录 LeetCode 算法题的过程,其中代码使用的是C++,不定期更新。

其中一些中会有解释与注释,大部分是没有解释与注释的。



Number 0001 - 0050

#TitleDifficultyTag
0001Two SumEasy
0002Add Two NumbersMedium
0003Longest Substring Without Repeating CharactersMedium
0004Median of Two Sorted ArraysHardBinary-search
0005Longest Palindromic SubstringMedium
0006ZigZag ConversionMedium
0007Reverse IntegerEasy
0008String to Integer (atoi)Medium
0009Palindrome NumberEasy
0010Regular Expression MatchingHardBacktracking
0011Container With Most WaterMedium
0012Integer to RomanMedium
0013Roman to IntegerEasy
0014Longest Common PrefixEasy
00153SumMedium
00163Sum ClosestMedium
0017Letter Combinations of a Phone NumberMediumBacktracking
00184SumMedium
0019Remove Nth Node From End of ListMedium
0020Valid ParenthesesEasy
0021Merge Two Sorted ListsEasy
0022Generate ParenthesesMediumBacktracking
0023Merge k Sorted ListsHardDivide and Conquer
0024Swap Nodes in PairsMedium
0025Reverse Nodes in k-GroupHardLinked List
0026Remove Duplicates from Sorted ArrayEasy
0027Remove ElementEasy
0028Implement strStr()Easy
0029Divide Two IntegersMediumBinary-search
0030Substring with Concatenation of All WordsHardHash Table
0031Next PermutationMedium
0032Longest Valid ParenthesesHard
0033Search in Rotated Sorted ArrayMediumBinary-search
0034Find First and Last Position of Element in Sorted ArrayMediumBinary-search
0035Search Insert PositionEasyBinary-search
0036Valid SudokuMedium
0037Sudoku SolverHardBacktracking
0038Count and SayEasy
0039Combination SumMediumBacktracking
0040Combination Sum IIMediumBacktracking
0041First Missing PositiveHardArray
0042Trapping Rain WaterHardTwo Pointers
0043Multiply StringsMedium
0044Wildcard MatchingHardDynamic Programming
0045Jump Game IIHardGreedy
0046PermutationsMediumBacktracking
0047Permutations IIMediumBacktracking
0048Rotate ImageMediumArray
0049Group AnagramsMediumHash Table
0050Pow(x, n)MediumBinary-search

Number 0051 - 0100

#TitleDifficultyTag
0051N-QueensHard
0052N-Queens IIHard
0053Maximum SubarrayEasyDivide and Conquer
0054Spiral MatrixMedium
0055Jump GameMedium
0056Merge IntervalsMedium
0057Insert IntervalHard
0058Length of Last WordEasy
0059Spiral Matrix IIMedium
0060Permutation SequenceMediumMath Backtracking
0061Rotate ListMediumLinked List, Two Pointers
0062Unique PathsMediumArray, Dynamic Programming
0063Unique Paths IIMediumArray, Dynamic Programming

算法 - 查找 - 插值查找 (Interpolation Search) 插值查找 (Interpolation Search) 阅读详情

相关推荐

算法 - 图的实例 - 最短路径 (Shortest Path)

本文将介绍最短路径的基础知识,并用C++实现迪杰斯特拉算法(Dijkstra)和弗洛伊德算法(Floyed)。

DarkRabbit的专栏 2052

LeetCode-1418. 点菜展示表

本题是一道分析给定数据的模拟题,它的思维难度不高,但需要一定的代码功底。

yshuoo的博客 261

编程基础 - 队列实例 - 售票排队问题 (Queue Ticketing)

队列实例 - 售票排队问题 (Queue Ticketing)

DarkRabbit的专栏 1960

LeetCode Algorithm 0051 - 0055

0051 - N-Queens (Hard), 0052 - N-Queens II (Hard), 0053 - Maximum Subarray (Easy), 0054 - Spiral Matrix (Medium), 0055 - Jump Game (Medium)

DarkRabbit的专栏 293

算法 - 排序 - 交换排序 (Swap Sort)

冒泡排序(Bubble Sort), 快速排序(Quick Sort)

DarkRabbit的专栏 1901

Ubuntu20.04安装Torque-6.1.2单机版(踩坑篇)

说明:PBS排队系统原先是在Centos7安装使用很顺利,但是有客户需求在Ubuntu20.04上使用,着手在Ubuntu20.04安装上安装的时候发现很多报错,并不能顺利安装,网上查找到的教程,有的说是让放弃转slurm,有的是换源安装,但是安装好的版本很低,有许多bug,不是很好用。经过自己慢慢摸索之后,改了部分配置以及源码之后,能够顺利安装,再次记录一下踩坑心得,与大家一起分享学习。如有问题,欢迎大家来撩。...............

华青水上的博客 8104

LeetCode Algorithm部分

LeetCode Algorithm部分.004【004】 Search a 2D Matrix II Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

mattmu的博客 430

深入解析poi-tl自定义表格渲染插件中的多级子循环实现

本文深入解析了poi-tl自定义表格渲染插件中的多级子循环实现,详细介绍了其在处理复杂业务数据时的核心价值、实现原理及实战技巧。通过多级子循环机制,开发者可以高效地将层级数据结构渲染到Word表格中,显著提升代码简洁性和维护效率。文章还分享了性能优化和异常处理经验,帮助开发者更好地应用该插件。

weixin_33734785的博客 496

LeetCode Algorithm 0041 - 0045

0041 - First Missing Positive (Hard) 0042 - Trapping Rain Water (Hard) 0043 - Multiply Strings (Medium) 0044 - Wildcard Matching (Hard) 0045 - Jump Game II (Hard)

DarkRabbit的专栏 440

Altium Designer 16来自原理图/PCB的各种报错 (持续更新):

NO1.Nets with only one pin: 根本原因: 在BGA的原理图绘制时,我一般习惯拉出该元件的所有IO的网络,这方便利于我开发其他款板卡。同样也会因为不同板卡的需求不同而造成有些IO并没有使用到,也就是整个原理图中only one pin。 解决方案: 鼠标右键工程文件>工程参数>下图圈中的选项将“错误”更改为“警告/不报告” ...

CSDN@猿谷攻城狮 1万+

告别理论!用AXI-Stream实战摄像头数据流采集(附Verilog关键代码片段)

本文详细解析了如何通过AXI-Stream接口实现工业级可靠性的摄像头数据流采集系统,重点介绍了Verilog实战代码、AXI-Stream握手机制及数据反压处理方案。通过三级缓冲架构和带宽优化,有效解决了OV5640等摄像头在高速场景下的帧丢失问题,为FPGA图像处理项目提供了实用解决方案。

weixin_42563415的博客 161

LeetCode Algorithm

刷lc不为其他,只为工程能力扩展与思维提升! 请看github:leetCode   Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exact...

MachineLP的专栏 362

Spark 大数据环境搭建( Linux 系统安装和配置)

(1)选择典型安装(2)选择“安装程序光盘映像文件(iso)”,点击右侧的浏览按钮, 找到下载好的iso 文件,然后点击下一步。(3)将全名、用户名、密码、确认等几项均设为“spark”, 方便后面使用,然后点击下一步。(4)在命名虚拟机的窗体中,可以设定一下虚拟机名称或直接按默认,然后点击下一步。(5)在指定磁盘容量的窗体中,设定虚拟机使用的最大磁盘大小为60GB,虚拟机文件尺 寸是在使用过程中按需增长的,最大限制为 60GB。

2301_80186825的博客 1610

C语言与C++自学指南:从零构建编程思维与实战能力

编程语言是计算机科学的基础工具,其核心在于通过语法规则将人类逻辑转化为机器可执行的指令。C语言作为系统编程的基石,其设计原理贴近硬件底层,通过指针直接操作内存,实现了极高的执行效率与控制力,这种特性使其成为操作系统、嵌入式系统等高性能软件的首选。掌握C语言不仅意味着学会一门语法,更是深入理解计算机工作原理、锻炼底层抽象思维的关键过程。在工程实践中,C语言常与C++结合,后者在保留C高效特性的基础上,引入了面向对象和泛型编程等现代范式,极大地提升了大型软件工程的可维护性与开发效率。无论是开发系统软件、游戏引擎

weixin_33858336的博客 429

电子元器件-三极管终终篇:三极管工作原理详解、参数/手册详解、开关应用详解、Ib电流研究、开关应用实例

三极管工作原理与应用摘要 三极管是一种电流控制器件,通过小基极电流控制大集电极电流。其内部结构由高掺杂发射区、薄低掺杂基区和中等掺杂集电区组成,形成NPN或PNP结。三极管有三种工作状态: 截止区:发射结和集电结均反偏,无放大作用 放大区:发射结正偏,集电结反偏,Ic=βIb 饱和区:两结均正偏,Ic不再随Ib增大 作为开关使用时,需确保三极管深度饱和(Vce≈0.2V)。设计要点包括: 基极电阻计算确保Ib足够大 集电极电阻控制Ic 基极加下拉电阻提高抗干扰 NPN管作地开关,PNP管作电源开关 典型应用

qq_60226558的博客 341

【20】方案管理器

方案管理器是Excel中一个非常强大且灵活的工具,适合用于多情景分析和比较。在复杂的决策过程中,它可以帮助用户快速管理和评估不同变量组合下的结果,从而优化决策过程。

学习,输出==》再学习再输出 1600

LeetCode 算法学习指南

本文来自微信公众号:labuladong 之前发的那篇关于 框架性思维 的文章,我也发到了不少其他圈子,受到了大家的普遍好评,这一点我真的没想到,首先感谢大家的认可,我会更加努力,写出通俗易懂的算法文章。 有很多朋友问我数据结构和算法到底该怎么学,尤其是很多朋友说自己是「小白」,感觉这些东西好难啊,就算看了之前的「框架思维」,也感觉自己刷题乏力,希望我能聊聊我从一个非科班小白一路是怎么学过来的。 ...

fdl123456的博客 7619

YOLO26涨点改进 | NeurIPS2025最佳论文!注意力改进篇| 引入Gated Attention门控注意力模块、太牛了!直接拯救了大模型的发展,助力目标检测、图像分割、图像分类有效涨点

本文提出了一种基于门控注意力机制(GatedAttention)的YOLO26模型改进方法。该方法在标准softmax注意力机制中引入头部特定的sigmoid门控,通过增强注意力机制使模型更聚焦于关键信息。实验表明,该模块能显著提升模型性能,特别是在复杂背景和密集目标场景中,同时减少无关区域关注并提高检测精度。门控机制引入的非线性和稀疏性不仅提升了推理效率,还改善了训练稳定性,使模型能采用更大学习率并增强扩展性。此外,该方法有效缓解了"注意力下沉"现象,增强了模型对长距离目标的感知能力。

Ai缝合怪、助力小伙伴高效发论文 672

leetcode algo NO.171 python solution

class Solution: def titleToNumber(self, s): """ :type s: str :rtype: int """ sum = 0 for i in range(len(s)): sum += (ord(s[-(i+1)])-64) ...

Peter-Chou的博客 256

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

A*寻路初探 GameDev.net

A*寻路初探 GameDev.net作者: Patrick Lester译者:Panic 2005年3月18日译者序:很久以前就知道了A*算法,但是从未认真读过相关的文章,也没有看过代码,只是脑子里有个模糊的概念。这次决定从头开始,研究一下这个被人推崇备至的简单方法,作为学习人工智能的开始。这篇文章非常知名,国内应该有不少人翻译过它,我没有查找,觉得翻译本身也是对自身英文水平的锻炼。经

原始世界 5483

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

数学基础 - 线性空间(Vector Space)

线性空间(Vector Space) 定义(Definition) 设V是一个非空集合,P是一个域: 加法:∀α,β∈V∀α,β∈V\forall \; \alpha,\beta \in V,总有唯一元素γ∈Vγ∈V\gamma \in V与之对应,称为αα\alpha与ββ\beta的和,记作γ=α+βγ=α+β\gamma = \alpha + \beta。 纯量乘法(数量乘法):...

DarkRabbit的专栏 1万+

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

算法 - 查找 - 斐波那契查找 (Fibonacci Search)

斐波那契查找 (Fibonacci Search)

DarkRabbit的专栏 1万+

编程基础 - 栈的应用 - 混洗(Stack Shuffling)

栈的混洗的实现(Stack Shuffling)

DarkRabbit的专栏 5112

算法 - 排序 - 二路归并排序 (Two-way Merge Sort)

二路归并排序 (Two-way Merge Sort)

DarkRabbit的专栏 2926

编程基础 - 进制转换(Binary Conversion)

1 进制(System of Numeration), 2 其它进制转十进制(Others to DEC), 3 十进制转换其它进制(DEC to Others), 4 二进制与其乘方进制(BIN and Power N), 5 位运算(Bitwise)

DarkRabbit的专栏 2259

编程基础 - 栈的应用 - 括号匹配问题(Bracket Matching)

使用栈实现括号匹配问题(Bracket Matching)

DarkRabbit的专栏 2008
上一篇: LeetCode Algorithm 0046 - 0050
下一篇: SRPG游戏开发(三十一)第八章 游戏中的数据 - 一 创建新项目(Create New Project)
沙沙的兔子
博客等级 码龄17年 360粉丝 135原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值