文章
【Leetcode】7. Reverse Integer 整数字面反转
1.题目Reversedigitsofaninteger.Example1:x123,return321Example2:x123,return3212.思路如果是负数,先转换为正数在处理,处理之后再补上符号位。通过模10、余
【leetcode】5. Longest Palindromic Substring 最长回文子串
1.题目GivenastringS,findthelongestpalindromicsubstringinS.YoumayassumethatthemaximumlengthofSis1000,andthereexistsoneun
【leetcode】4. Median of Two Sorted Arrays 两个有序数组组成集合的中位数
1.题目Therearetwosortedarraysnums1andnums2ofsizemandnrespectively.Findthemedianofthetwosortedarrays.Theoverallruntimec
【Leetcode】3. Longest Substring Without RepeatingCharacters无重最长子串
1.题目Givenastring,findthelengthofthelongestsubstringwithoutrepeatingcharacters.Examples:Given&34;abcabcbb&34;,theansweris
【Leetcode】1. Two Sum 集合中找到两个元素之和等于给定值
1.题目Givenanarrayofintegers,returnindicesofthetwonumberssuchthattheyadduptoaspecifictarget.Youmayassumethateachinputw
实时多项式拟合
原文出自【听云技术博客】:(https://link.segmentfault.com/?encoks3yEhXgCUVQbCrOqHBcw%3D%3D.%2BoLq1l4W9OSPhEYrQbJOj%2FQut6yHebDrNsX8Smnv6IIdlmmr3eUSNlz4ciar9E9x)
进化「发现」的进化算法
生物之中的各种现象为包括计算机科学在内的科学和工程的很多领域带来了灵感和启发。其中生物进化的现象和机制启发了我们设计很多进化算法(https://link.segmentfault.com/?encaW2vbmqdSjXRj3yyKQRBLA%3D%3D.l7XzU2vkbigaTZsgGRl
蓄水池抽样(Reservoir sampling)
题目要求从个元素中随机抽取个元素,但的个数无法事先确定。在实际应用中,往往会遇到很大数据流的情况。因此,我们无法先保存整个数据流然后再从中选取,而是期望有一种将数据流遍历一遍就得到所选取的元素,并且保证得到的元素是随机的算法。蓄水池抽样算法先选取个元素中的前个元素,保存
快速排序思想及实现
思想&34;快速排序&34;的思想很简单,整个排序过程只需要三步:(1)在数据集之中,找一个基准点(2)建立两个数组,分别存储左边和右边的数组(3)利用递归进行下次比较JS实现<pre<codevarneedSortArr12,23
用Java实现一些简单算法
for循环,外循环控制的是行数,内循环控制的是每一行的个数。<pre<codefor(intx0;x<4;x){//外循环控制的是行数for(inty0;y<5;y){//
已加载文章中没有匹配内容,试试其他关键词或清空搜索。