Java 内存分配全面浅析
摘要:本文将由浅入深详细介绍Java内存分配的原理,以帮助新手更轻松的学习Java。这类文章网上有很多,但大多比较零碎。本文从认知过程角度出发,将带给读者一个系统的介绍。进入正题前首先要知道的是Java程序运行在JVM(Java Virtual Machine,Java虚拟机)上,可以把JVM理解成Jav...
阅读全文
posted @
2017-06-24 15:21
lantx
阅读(171)
推荐(0)
线性回归与逻辑回归思考
摘要:在学习完 Andrew Ng 教授的机器学习课程,和多方查阅大神的博客,本以为很简单的逻辑回归,在深思其细节的时候,很多容易让人不理解,甚至是疑惑的地方,这几天一直冥想其中的缘由。1、 为什么是逻辑回归? 都说线性回归用来做回归预测,逻辑回归用于做二分类,一个是解决回归问题,一个用于解决分类问...
阅读全文
posted @
2017-06-22 21:54
lantx
阅读(222)
推荐(0)
并发、并行、同步、异步、多线程的区别
摘要:1. 并发:在操作系统中,是指一个时间段中有几个程序都处于已启动运行到运行完毕之间,且这几个程序都是在同一个处理机上运行。其中两种并发关系分别是同步和互斥。2. 互斥:进程间相互排斥的使用临界资源的现象,就叫互斥。3. 同步:进程之间的关系不是相互排斥临界资源的关系,而是相互依赖的关系。进一步的说明...
阅读全文
posted @
2017-06-22 18:39
lantx
阅读(296)
推荐(0)
Leetcode 55. Jump Game
摘要:题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents ...
阅读全文
posted @
2017-06-12 17:07
lantx
阅读(192)
推荐(0)
Leetcode 300. Longest Increasing Subsequence
摘要:题目:Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The...
阅读全文
posted @
2017-06-12 16:00
lantx
阅读(116)
推荐(0)
Leetcode 147. Insertion Sort List
摘要:题目:Sort a linked list using insertion sort.思路: 使用一个指针p指向未排好序的链表的第一个结点,在排序好的部分中找到找第一个大于等于q的前驱结点,将p对应的结点插入到正确位置,p重新指向未排好序的链表的第一个结点。直到链表完成排序好。 代码...
阅读全文
posted @
2017-06-12 15:44
lantx
阅读(154)
推荐(0)
Leetcode 17. Letter Combinations of a Phone Number
摘要:题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on t...
阅读全文
posted @
2017-06-12 15:04
lantx
阅读(112)
推荐(0)
Leetcode 14. Longest Common Prefix
摘要:题目:Write a function to find the longest common prefix string amongst an array of strings.思路:先定最长的公共前缀为第一个字符串, 然后依次将这个与剩余的字符串作比较,得出最小的长度 即为最长公共...
阅读全文
posted @
2017-06-12 14:31
lantx
阅读(88)
推荐(0)
Leetcode 5. Longest Palindromic Substring
摘要:题目:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: “babad”Ou...
阅读全文
posted @
2017-06-12 13:53
lantx
阅读(139)
推荐(0)