上一页 1 2 3 4 5 6 7 8 ··· 36 下一页
摘要: 前序遍历+重赋值 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(i 阅读全文 »
posted @ 2020-08-02 17:18 浅滩浅 阅读(79) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/hejingyuan6/article/details/36203505 阅读全文 »
posted @ 2020-07-31 17:41 浅滩浅 阅读(53) 评论(0) 推荐(0)
摘要: #饿汉式 public class Singleton{ public final static INSTANCE = new Singleton(); private Singleton(){ } } /*枚举类型限制对象个数,当我们只写一个就变成了单例模式 */ public enum Sing 阅读全文 »
posted @ 2020-07-31 17:00 浅滩浅 阅读(85) 评论(0) 推荐(0)
摘要: ##暴力题解:双重for循环,时间复杂度O(n^2) class Solution { public int max(int a,int b){ if(a>=b) return a; return b; } public int min(int a,int b){ if(a>=b) return b 阅读全文 »
posted @ 2020-07-31 16:14 浅滩浅 阅读(168) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/magic-index-lcci/ 间接跳跃查找(leetcode给的测试好像都是递增的) class Solution { public int findMagicIndex(int[] nums) { for(int i 阅读全文 »
posted @ 2020-07-31 14:57 浅滩浅 阅读(120) 评论(0) 推荐(0)
摘要: #问题描述 Serling公司购买长钢条,将其切割为短钢条出售。切割工序本身没有成本支出。公司管理层希望知道最佳的切割方案。 假定我们知道Serling公司出售一段长为i英寸的钢条的价格为pi(i=1,2,…,单位为美元)。钢条的长度均为整英寸。 长度i 1 2 3 4 5 6 7 8 9 10 价 阅读全文 »
posted @ 2020-07-29 23:12 浅滩浅 阅读(248) 评论(0) 推荐(0)
摘要: 以.进行分割,逐一进行转义//. ,之后数字进行比较就ok了 class Solution { public int compareVersion(String version1, String version2) { String [] v1 = version1.split("\\.");//. 阅读全文 »
posted @ 2020-07-29 21:55 浅滩浅 阅读(193) 评论(0) 推荐(0)
摘要: 深度优先 class Solution { public boolean exist(char[][] board, String word) { char[] words = word.toCharArray(); int m = words.length; boolean[][] visit = 阅读全文 »
posted @ 2020-07-29 14:52 浅滩浅 阅读(93) 评论(0) 推荐(0)
摘要: 深度优先搜索:将问题划分为,邻近的四个方向格子所能到达的格子数+1,由于又是从0,0开始的所以只用右、下两个方向的邻近格子就行了。 class Solution { boolean[][] visited; public int movingCount(int m, int n, int k) { 阅读全文 »
posted @ 2020-07-29 13:36 浅滩浅 阅读(115) 评论(0) 推荐(0)
摘要: 深入理解HTTPS工作原理: https://segmentfault.com/a/1190000018992153 阅读全文 »
posted @ 2020-07-28 21:01 浅滩浅 阅读(110) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 36 下一页
点击右上角即可分享
微信分享提示