Space Ant大意:有一只蚂蚁,每次都只向当前方向的左边走,问蚂蚁走遍所有的点的顺序输出。开始的点是纵坐标最小的那个点,开始的方向是开始点的x轴正方向。思路:从开始点开始,每次找剩下的点中与当前方向所形成的夹角最小的点,为下一个要走的点(好像就是犄角排序,我不是很会),夹角就是用点积除以两个向量...
分类:
其他好文 时间:
2014-06-25 23:04:20
阅读次数:
205
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-06-25 23:01:44
阅读次数:
227
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2014-06-25 10:30:08
阅读次数:
220
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2014-06-25 09:17:03
阅读次数:
159
今天新能测试组的同事找我看一个奇怪的现象。一个tomcat应用,里面只有一个单纯的jsp页面,而且这个jsp页面没有任何java代码(想用这个jsp页面测试在她的服务器上的一个tomcat的最大QPS)。但是用loadrunner压测了几分钟之后,分配了1024M堆内存的tomcat居然包heap space outofmemory!这个页面的代码如下:
<%@ page language=...
分类:
Web程序 时间:
2014-06-25 00:03:19
阅读次数:
297
《机器学习那些事》介绍了一些机器学习应用中需要了解的“民间知识”。
原文为:
A Few Useful Things to Know about Machine Learning
摘录若干要点:
1. 学习 = 表示 + 评价 + 优化
表示(Representation) : 学习器的假设空间(hypothesis space)
评价(Evalua...
分类:
其他好文 时间:
2014-06-24 22:59:39
阅读次数:
325
Space Ant
大意:有一只蚂蚁,每次都只向当前方向的左边走,问蚂蚁走遍所有的点的顺序输出。开始的点是纵坐标最小的那个点,开始的方向是开始点的x轴正方向。
思路:从开始点开始,每次找剩下的点中与当前方向所形成的夹角最小的点,为下一个要走的点(好像就是犄角排序,我不是很会),夹角就是用点积除以两个响亮的距离,求一下acos值。
之前一直用叉积做,做了好久阳历都没过,...
分类:
其他好文 时间:
2014-06-24 22:00:39
阅读次数:
274
leetcode:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last...
分类:
其他好文 时间:
2014-06-22 13:41:07
阅读次数:
154
Sort a linked list in O(n log n)
time using constant space complexity.
这道题目非常简短的一句话,给链表排序,看到nlogn,我们可以来简单复习一下排序。首先说一下这个nlogn的时间复杂度(根据决策树我们可以得出这个界限),是基于比较排序的最小上限,也就是说,对于没有一定范围情况的数据来说,最快的排序思路就是归并和快速排...
分类:
其他好文 时间:
2014-06-22 09:02:54
阅读次数:
250
Eclipse运行程序提示:Exception in thread "main" java.lang.OutOfMemoryError: Java heap space...
分类:
编程语言 时间:
2014-06-21 21:41:22
阅读次数:
336