2017年7月1日
摘要: STINGY SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, find a satisfying assignment in which a... 阅读全文
posted @ 2017-07-01 10:49 lantx 阅读(435) 评论(0) 推荐(0) 编辑
  2017年6月24日
摘要: 本文将由浅入深详细介绍Java内存分配的原理,以帮助新手更轻松的学习Java。这类文章网上有很多,但大多比较零碎。本文从认知过程角度出发,将带给读者一个系统的介绍。进入正题前首先要知道的是Java程序运行在JVM(Java Virtual Machine,Java虚拟机)上,可以把JVM理解成Jav... 阅读全文
posted @ 2017-06-24 15:21 lantx 阅读(165) 评论(0) 推荐(0) 编辑
  2017年6月22日
摘要: 在学习完 Andrew Ng 教授的机器学习课程,和多方查阅大神的博客,本以为很简单的逻辑回归,在深思其细节的时候,很多容易让人不理解,甚至是疑惑的地方,这几天一直冥想其中的缘由。1、 为什么是逻辑回归? 都说线性回归用来做回归预测,逻辑回归用于做二分类,一个是解决回归问题,一个用于解决分类问... 阅读全文
posted @ 2017-06-22 21:54 lantx 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 1. 并发:在操作系统中,是指一个时间段中有几个程序都处于已启动运行到运行完毕之间,且这几个程序都是在同一个处理机上运行。其中两种并发关系分别是同步和互斥。2. 互斥:进程间相互排斥的使用临界资源的现象,就叫互斥。3. 同步:进程之间的关系不是相互排斥临界资源的关系,而是相互依赖的关系。进一步的说明... 阅读全文
posted @ 2017-06-22 18:39 lantx 阅读(274) 评论(0) 推荐(0) 编辑
  2017年6月12日
摘要: 题目: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 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目: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 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目:Sort a linked list using insertion sort.思路: 使用一个指针p指向未排好序的链表的第一个结点,在排序好的部分中找到找第一个大于等于q的前驱结点,将p对应的结点插入到正确位置,p重新指向未排好序的链表的第一个结点。直到链表完成排序好。 代码... 阅读全文
posted @ 2017-06-12 15:44 lantx 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目: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 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a function to find the longest common prefix string amongst an array of strings.思路:先定最长的公共前缀为第一个字符串, 然后依次将这个与剩余的字符串作比较,得出最小的长度 即为最长公共... 阅读全文
posted @ 2017-06-12 14:31 lantx 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 题目: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 阅读(134) 评论(0) 推荐(0) 编辑