while(true)offer*=2;
while(true)offer*=2;
全部文章
分类
Go语言算法系列(1)
冲刺Google系列(2)
未归档(1)
算法学习记录(5)
归档
标签
去牛客网
登录
/
注册
while(true)offer*=2;的博客
人生就是一段不断发现问题,制造问题,并解决问题的过程!
全部文章
(共9篇)
1.基础算法 - 高精度,前缀和与差分
高精度算法一般考四种:在java和python中不需要考虑这个问题。因为java中有大整数类。1.两个大整数相加A + B ,一般位数在10的6次方!2.两个大整数相减A - B3.一个大整数乘一个小整数 A * a len(A)<=1e6, a <=1e94.A / a 求商和余数大整...
2019-12-21
0
656
1.基础算法 - 排序,二分
排序:1.快排2.归并排序二分:1.整数二分【重点】2.小数二分(浮点数二分)【相对简单】 快排的基本思想:基于分治1.确定分界点 x【对于左右边界l和r】一般四种方式都可以:q[l],q[(l+r)/2],q[r],随机2.调整区间使得左边的所有数据都<=x;右边的数据都>=x;3.递...
2019-12-20
1
524
求解素数
求解前100个素数 func test(){ var i,j int for i=2; i < 100; i++{ for j=2; j <= (i/j); j++{ if i%j == 0{ bre...
2019-10-27
0
378
Leetcode93 复原IP地址
class Solution { private List<String> res = new ArrayList<>(); public List<String> restoreIpAddresses(String s) { if...
2019-09-26
0
484
Leetcode18: 四数之和
class Solution { //主函数调用 public List<List<Integer>> fourSum(int[] nums, int target) { Arrays.sort(nums); List<L...
2019-09-23
0
399
Leetcode572 树t是否为树s的子树
先是原始解法,采用递归的方式,代码如下: class Solution { public boolean isSameTree(TreeNode s, TreeNode t){ if(s == null && t == null) return true; ...
2019-09-18
0
527
leetcode拓扑排序专题记录
课程表2问题的两种解法解法一:拓扑排序,根据节点的入度信息 public class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { // 先处理极端情况 ...
2019-08-24
0
725
简易正则表达式匹配
学习了大佬的写法,这里采用的是一个二位数组记录状态,后续的优化过程还没发一下子写出来 public class Solution { public boolean match(char[] str, char[] pattern) { if(str == null ...
2019-08-19
0
404
二叉搜索树与双向链表
public class Solution { TreeNode head = null; TreeNode realHead = null; public TreeNode Convert(TreeNode root) { if(root == null) ...
2019-07-27
0
424