05 2014 档案
摘要:Problem: Given a two-dimensional graph with points on it, find a line which passes the most number of points.此题是Cracking the code 5th edition 第七章第六题,思...
阅读全文
摘要:The tricky thing is how to decide the key for a hashmap. Especially when you intend to use self-defined objects as key.If you want to make two differe...
阅读全文
摘要:今天发现一小技巧,关于如何把Eclipse的某一个Existing project push 到github服务器。Eclipse 应该是 JavaEE 版本。在project 右键 team, git 什么的commit一下。目的是生成 local repository。然后去打开windows版...
阅读全文
摘要:在Eclipse里初次使用Maven,右键project->add dependency, 发现search不管用,这时候需要按照以下步骤操作:Goto "Preferences -> Maven"Check"Download repository index updates on start"an...
阅读全文
摘要:给一个Binary Tree,检查是不是Binary Search Tree. 即是否满足对每个节点,左子树的中的所有节点的值 = root.val){ // only 'Less than' is valid return false; } ...
阅读全文
摘要:问题:给一个二叉树,写一个算法判断这个树是不是balanced。Solution #1.第一次遇到这个问题时我的解法,如下:public class Solution { public boolean isBalanced(TreeNode root) { if(root == ...
阅读全文