自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Carroll的博客

谦虚、勇敢且真诚待人做事;重基础,用心做技术。

  • 博客(28)
  • 资源 (9)
  • 收藏
  • 关注

原创 力扣---2020.7.13

350. 两个数组的交集 IIclass Solution { public int[] intersect(int[] nums1, int[] nums2) { Map<Integer,Integer> map = new HashMap<>(); for(int num : nums1){ map.put(num,map.getOrDefault(num,0)+1); } List

2020-09-28 20:55:40 149

原创 力扣---2020.7.12

174. 地下城游戏class Solution { public int calculateMinimumHP(int[][] dungeon) { int[][] dp = new int[dungeon.length][dungeon[0].length]; int res = 0; for(int i=dungeon.length-1;i>=0;i--){ for(int j=dungeon[0].length-

2020-09-27 00:07:49 130

原创 机器学习常用算法分享

文章目录KNN原理优缺点逻辑斯蒂函数原理优缺点决策树原理优缺点朴素贝叶斯支持向量机自适应提升算法KNNK-近邻算法(k-Nearest Neighbor,KNN)采用测量不同特征值之间的距离方法进行分类。原理已知的数据分为两类:一类是蓝色的正方形,一类是红色的三角形。绿色圆形是待分类的数据。当K=3和K=5时,得到的分类结果不同。KNN本质是基于一种数据统计的方法。度量空间中点之间的距离,常见的曼哈顿距离计算,欧式距离计算等等。不过通常KNN算法中使用的是欧式距离。二维空间两

2020-09-26 14:41:34 336

原创 力扣---2020.7.11

315. 计算右侧小于当前元素的个数//暴力,超时了 hhahahaclass Solution { public List<Integer> countSmaller(int[] nums) { int len = nums.length; List<Integer> res = new ArrayList<>(); for(int i = 0;i < len ;i++){ in

2020-09-25 16:22:03 151

原创 力扣---2020.7.10

309. 最佳买卖股票时机含冷冻期class Solution { public int maxProfit(int[] prices) { int m = prices.length; int[][] dp = new int[m+2][2]; int temp = 0; for(int i = m - 1;i >= 0;i--){ // 当手里无股票时:选择1:现在买,那么第i+1天就是有股票的,所以

2020-09-23 23:27:19 227

原创 力扣---2020.7.9

面试题 17.13. 恢复空格class Solution { public int respace(String[] dictionary, String sentence) { Set<String> dict = new HashSet<>(Arrays.asList(dictionary)); int n = sentence.length(); int[] dp = new int[n + 1]; f

2020-09-22 22:38:36 160

原创 力扣---2020.7.8

面试题 16.11. 跳水板class Solution { public int[] divingBoard(int shorter, int longer, int k) { if(k<1){ return new int[]{}; } if(shorter==longer){ return new int[]{shorter*k}; } int[] res =

2020-09-21 23:16:44 149

原创 力扣---2020.7.7

112. 路径总和class Solution { public boolean hasPathSum(TreeNode root, int sum) { if(root==null) return false; sum -= root.val; if(root.left==null && root.right==null){ return sum==0; } return ha

2020-09-20 21:38:11 154

原创 力扣---2020.7.6

63. 不同路径 IIclass Solution { public int uniquePathsWithObstacles(int[][] obstacleGrid) { if(obstacleGrid.length==0 || obstacleGrid == null){ return 0; } int m = obstacleGrid.length; int n = obstacleGrid[0].l

2020-09-19 22:15:13 130

原创 力扣---2020.7.5

44. 通配符匹配class Solution { public boolean isMatch(String s, String p) { boolean[][] dp = new boolean[s.length()+1][p.length()+1]; //dp[i][j] 表示s的前i个字符和p的前j个字符是否完全匹配 dp[0][0] = true; for(int j = 1;j <= p.length();j++)

2020-09-18 20:11:37 91

原创 力扣---2020.7.4

32. 最长有效括号public class Solution { public int longestValidParentheses(String s) { int maxans = 0; int dp[] = new int[s.length()]; for (int i = 1; i < s.length(); i++) { if (s.charAt(i) == ')') { if

2020-09-17 21:34:55 150

原创 力扣---2020.7.3

108. 将有序数组转换为二叉搜索树class Solution { public TreeNode sortedArrayToBST(int[] nums) { return nums == null ? null:buildTree(nums,0,nums.length-1); } public TreeNode buildTree(int[] nums,int left,int right){ if(left>right) return

2020-09-16 21:00:25 84

原创 力扣---2020.7.2

378. 有序矩阵中第K小的元素class Solution { public int kthSmallest(int[][] matrix, int k) { int rows = matrix.length, columns = matrix[0].length; int[] sorted = new int[rows * columns]; int index = 0; for (int[] row : matrix) {

2020-09-15 21:10:07 92

原创 力扣---2020.7.1

718. 最长重复子数组class Solution { public int findLength(int[] A, int[] B) { if(A.length == 0 || B.length == 0){ return 0; } int m = A.length; int n = B.length; int[][] dp = new int[m+1][n+1]; //dp

2020-09-15 00:05:12 140

原创 力扣---2020.6.30

剑指 Offer 09. 用两个栈实现队列class CQueue { LinkedList<Integer> stack1; LinkedList<Integer> stack2; public CQueue() { stack1 = new LinkedList<>(); //come stack2 = new LinkedList<>(); // out } publ

2020-09-13 20:19:02 140

原创 力扣---2020.6.29

215. 数组中的第K个最大元素class Solution { public int findKthLargest(int[] nums, int k) { //bubbleSort(nums); //selectSort(nums); quickSort(nums,0,nums.length-1); return nums[nums.length-k]; } public void quickSort(int[]

2020-09-12 22:33:01 108

原创 力扣---2020.6.28

209. 长度最小的子数组class Solution { public int minSubArrayLen(int s, int[] nums) { int i = 0; int sum = 0; int len = 0; for (int j = 0; j < nums.length; j++) { sum += nums[j]; while (sum >= s) {

2020-09-11 18:38:13 133

原创 力扣---2020.6.27

41. 缺失的第一个正数public class Solution { public int firstMissingPositive(int[] nums) { int len = nums.length; for (int i = 0; i < len; i++) { while (nums[i] > 0 && nums[i] <= len && nums[nums[i] - 1] !=

2020-09-10 20:16:17 151

原创 力扣---2020.6.26

面试题 02.01. 移除重复节点class Solution { public ListNode removeDuplicateNodes(ListNode head) { if (head == null) { return null; } ListNode dummyHead = new ListNode(-1); dummyHead.next = head; ListNode pre =

2020-09-09 19:39:42 129

原创 ML特征工程

文章目录1. 特征工程有哪些?1.1 数据处理异常值处理缺失值处理1.2 特征归一化线性函数归一化(Min-Max Scaling)零均值归一化(Z-Score Normalization)1.3 类别型特征序号编码独热编码(one-hot)二进制编码1.4 高维组合特征的处理1.5 文本表示模型词袋模型和N-gram模型主题模型词嵌入与深度学习模型1.6 数据分桶1.7 特征构造1.8 特征选择过滤式包裹式嵌入式PCA降维技术1.9 特征工程脑图2. 机器学习优化方法2.1 常用损失函数平方损失函数log

2020-09-08 23:51:51 648

原创 力扣---2020.6.25

139. 单词拆分class Solution { public boolean wordBreak(String s, List<String> wordDict) { int n = s.length(); boolean[] memo = new boolean[n+1]; memo[0] = true; for(int i = 1;i <= n;i++){ for(int j = 0;

2020-09-08 20:38:19 88

原创 力扣---2020.6.24

16. 最接近的三数之和class Solution { public int threeSumClosest(int[] nums, int target) { Arrays.sort(nums); int ans = nums[0] + nums[1] + nums[2]; for(int i = 0;i<nums.length;i++){ int start = i+1,end = nums.length-1;

2020-09-07 21:01:41 149

原创 力扣---2020.6.23

67. 二进制求和class Solution { public String addBinary(String a, String b) { if(a == null || a.length() == 0) return b; if(b == null || b.length() == 0) return a; StringBuilder sb = new StringBuilder(); int i = a.length()-1

2020-09-06 22:17:25 182

原创 力扣---2020.6.22

面试题 16.18. 模式匹配class Solution { public boolean patternMatching(String pattern, String value) { int count_a = 0, count_b = 0; for (char ch: pattern.toCharArray()) { if (ch == 'a') { ++count_a; } e

2020-09-05 21:18:11 149

原创 力扣---2020.6.21

124. 二叉树中的最大路径和class Solution { int ans = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { getMax(root); return ans; } public int getMax(TreeNode root){ if(root==null) return 0; int left = Math.max

2020-09-04 20:19:34 135

原创 力扣---2020.6.20

10. 正则表达式匹配class Solution { public boolean isMatch(String s, String p) { int sLen = s.length(), pLen = p.length(); boolean[][] memory = new boolean[sLen+1][pLen+1]; memory[0][0] = true; for(int i = 0; i <= sLen; i++) { for(int j =

2020-09-03 20:28:10 184

原创 力扣---2020.6.19

125. 验证回文串class Solution { public boolean isPalindrome(String s) { //双指针 s = s.toLowerCase(); int left = 0; int right = s.length()-1; while(left<right){ //Character.isLetterOrDigit(char ch) 确定指定的字

2020-09-02 21:26:19 145

原创 力扣---2020.6.18

1028. 从先序遍历还原二叉树class Solution { public TreeNode recoverFromPreorder(String S) { // 存储当前节点的路径 Deque<TreeNode> path = new LinkedList<TreeNode>(); // 存储字符串中的位置 int pos = 0; while (pos < S.length())

2020-09-01 21:44:25 164

15856_eec3d8ce85-背包问题知识框架图.png

背包问题知识框架图。背包问题(Knapsack problem)是一种组合优化的NP完全问题。问题可以描述为:给定一组物品,每种物品都有自己的重量和价格,在限定的总重量内,我们如何选择,才能使得物品的总价格最高。问题的名称来源于如何选择最合适的物品放置于给定背包中。相似问题经常出现在商业、组合数学,计算复杂性理论、密码学和应用数学等领域中。也可以将背包问题描述为决定性问题,即在总重量不超过W的前提下,总价值是否能达到V?

2020-05-11

新型肺炎实战.zip

数据分析是指用适当的统计分析方法对收集来的大量数据进行分析,将它们加以汇总和理解并消化,以求最大化地开发数据的功能,发挥数据的作用。数据分析是为了提取有用信息和形成结论而对数据加以详细研究和概括总结的过程。

2020-04-06

天池工业蒸汽.zip

数据分析是指用适当的统计分析方法对收集来的大量数据进行分析,将它们加以汇总和理解并消化,以求最大化地开发数据的功能,发挥数据的作用。数据分析是为了提取有用信息和形成结论而对数据加以详细研究和概括总结的过程。

2020-04-06

少年的你评论数据分析.zip

数据分析是指用适当的统计分析方法对收集来的大量数据进行分析,将它们加以汇总和理解并消化,以求最大化地开发数据的功能,发挥数据的作用。数据分析是为了提取有用信息和形成结论而对数据加以详细研究和概括总结的过程。

2020-04-06

金融反欺诈实战.zip

金融反欺诈实战。通过数据分析,锻炼自己的机器学习的能力和数据分析的能力。数据分析是指用适当的统计分析方法对收集来的大量数据进行分析,将它们加以汇总和理解并消化,以求最大化地开发数据的功能,发挥数据的作用。数据分析是为了提取有用信息和形成结论而对数据加以详细研究和概括总结的过程。

2020-04-06

国庆档电影数据分析.zip

国庆档电影数据分析。国庆档首日票房达7.96亿元,达同档期最高纪录;10月1日-10月7日期间,中国电影市场累计票房产出为43.86亿元,同比增长130.36%,打破了2017年26.29亿元的国庆档票房纪录,成为中国电影产业化改革以来,票房最高的国庆档。此外2019年国庆档仅用三天时间,就打破了2018年七天的票房纪录,算入9月30日票房,票房达到50.52亿,助推2019年年度票房实现同比反超。

2020-04-06

git常用命令.txt

Git常用命令总结。我在学习Git的过程中,买过书,也在网上Google了一堆Git相关的文章和教程,只支离破碎地介绍Git的某几个命令,还有直接从Git手册粘贴帮助文档的,学完后能立刻上手的Git教程。

2020-04-06

Spring-AOP.zip

spring aop的具体实现与理论.AOP(Aspect Oriented Programming),即面向切面编程,可以说是OOP(Object Oriented Programming,面向对象编程)的补充和完善。OOP引入封装、继承、多态等概念来建立一种对象层次结构,用于模拟公共行为的一个集合。

2020-04-06

mantisbt-2.24.0.tar.gz

Mantis是一个基于PHP技术的轻量级的开源缺陷跟踪系统,以Web操作的形式提供项目管理及缺陷跟踪服务。在功能上、实用性上足以满足中小型项目的管理及跟踪。更重要的是其开源,不需要负担任何费用。

2020-04-06

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除