摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2016-03-31 12:24 Joyce-Lee 阅读(163) 评论(0) 推荐(0) 编辑
摘要: An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla 阅读全文
posted @ 2016-03-31 12:13 Joyce-Lee 阅读(159) 评论(0) 推荐(0) 编辑
摘要: A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) 阅读全文
posted @ 2016-03-25 12:08 Joyce-Lee 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
posted @ 2016-03-23 12:19 Joyce-Lee 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2016-03-15 13:11 Joyce-Lee 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded 阅读全文
posted @ 2016-03-15 13:02 Joyce-Lee 阅读(168) 评论(0) 推荐(0) 编辑
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2016-03-14 05:45 Joyce-Lee 阅读(179) 评论(0) 推荐(0) 编辑
摘要: You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
posted @ 2016-03-14 05:22 Joyce-Lee 阅读(248) 评论(0) 推荐(0) 编辑
摘要: You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. 阅读全文
posted @ 2016-03-14 05:15 Joyce-Lee 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 在文件/etc/apache2/sites-available/000-default.conf 里 阅读全文
posted @ 2015-06-15 07:47 Joyce-Lee 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1.Given an array of integers, find a contiguous subarray which has the largest sum.hint: Go through the array with 2 variable -- cur and count. cur i... 阅读全文
posted @ 2015-05-21 15:27 Joyce-Lee 阅读(257) 评论(0) 推荐(0) 编辑
摘要: http://pages.cs.wisc.edu/~skrentny/cs367-common/readings/Red-Black-Trees/http://en.wikipedia.org/wiki/Red–black_tree1.Every node is either red or blac... 阅读全文
posted @ 2015-05-21 07:27 Joyce-Lee 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f... 阅读全文
posted @ 2015-05-20 15:03 Joyce-Lee 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given a BST, find 2 nodes in it which sum to a given targethint:Inorder traversal + BST + 2 SUM* Time : O(N)* Space: O(lgN) 1 class TreeNode0 { 2 ... 阅读全文
posted @ 2015-05-20 12:01 Joyce-Lee 阅读(327) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
posted @ 2015-05-20 07:08 Joyce-Lee 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Given one point P0 on a 2-dimension space.There are n other points on the same space.Try to find K points which are most closed to P0.hint: Part ofQu... 阅读全文
posted @ 2015-05-20 07:01 Joyce-Lee 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you ... 阅读全文
posted @ 2015-05-20 06:51 Joyce-Lee 阅读(319) 评论(0) 推荐(0) 编辑
摘要: Given an Array, find the number of inversion couples in the Arraye.g. 2, 4, 3, 1 4 -> (2,1), (3,1), (4,1), (4,3)hint:Solution 1* Iterate the whole a... 阅读全文
posted @ 2015-05-20 06:25 Joyce-Lee 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Given an ArrayList and a function " boolean test(someObject obj) "Test every element in the array list, delete all element that returns Fwith minimum ... 阅读全文
posted @ 2015-05-20 06:20 Joyce-Lee 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 各种 Sort 算法,包括 Quick Sort, Merge Sort, Heap Sort, Count Sort 1 package Sort; 2 3 public class Sort { 4 /* 5 * Quick Sort 6 * Tim... 阅读全文
posted @ 2015-05-20 06:09 Joyce-Lee 阅读(266) 评论(0) 推荐(0) 编辑
摘要: The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree.The diameter of a tree T... 阅读全文
posted @ 2015-05-20 05:41 Joyce-Lee 阅读(336) 评论(0) 推荐(0) 编辑
摘要: Let us consider the following 2 problems to understand Segment Tree.Problem 1 - Sum of Given RangeWe have an array arr[0 . . . n-1]. We should be able... 阅读全文
posted @ 2015-05-19 15:09 Joyce-Lee 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Fromgeeksquiz.com- Inheritance- Abstract Class and Interface- Arrays- Data Type- Constructor- Exception Handling- Operator- Package- Class and Object-... 阅读全文
posted @ 2015-05-19 14:04 Joyce-Lee 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 转载出处 http://www.cnblogs.com/AnnieKim/archive/2013/06/15/MorrisTraversal.html博主很认真,这里转载一下以防丢失链接本文主要解决一个问题,如何实现二叉树的前中后序遍历,有两个要求:1. O(1)空间复杂度,即只能使用常数空间;2... 阅读全文
posted @ 2015-04-28 03:08 Joyce-Lee 阅读(404) 评论(0) 推荐(0) 编辑
摘要: No.1Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.e.g.[−2,1,−3,4,−1,2,1,−5,4... 阅读全文
posted @ 2015-04-26 08:26 Joyce-Lee 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 文章 String S, 要查找的字符串 String W 重点:Get int T[] from W 用变量 c 来表示当前比较到的 W 中前面的字符,i 表示当前要处理的 T 中的 index,int[] T = new int[W.length];T[0] = -1; T[1] = 0;c=0 阅读全文
posted @ 2015-04-26 06:15 Joyce-Lee 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 最近被各种 encode 和 decode 算法虐得很晕,总结一下,但愿有通解😫No.1Compress a string to remove duplicates when a character occurs +2 times continuously.e.g.input : "12 abbb... 阅读全文
posted @ 2015-04-26 06:08 Joyce-Lee 阅读(410) 评论(0) 推荐(0) 编辑
摘要: You are given a grid of numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or the number belo... 阅读全文
posted @ 2014-10-09 12:35 Joyce-Lee 阅读(284) 评论(0) 推荐(0) 编辑
摘要: step 1. 关闭windows防火墙开始 -> 控制面板 -> 系统和安全 -> windows防火墙 -> 打开和关闭防火墙(这步后需要重启)step 2. 配置虚拟机和主机在一个局域网parallels右下角设置(点开设置,或先展开后点击蜘蛛网的图标), 或选择桥接网络下的“默认适配器”(mac地址应该有,博主涂掉了 :P)或step 3. win7中点开“网络和共享中心”看虚拟机ipv4本地连接 -> 详细信息 -> 抄下ipv4,子网等信息(截屏方便些)step 4. 固定ip (后测试这步不做貌似也可以)退回到本地连接 -> 属性 -&g 阅读全文
posted @ 2013-10-23 10:34 Joyce-Lee 阅读(942) 评论(0) 推荐(0) 编辑
摘要: \documentclass[letterpaper]{article}\usepackage{fancyhdr}\pagestyle{fancy}\fancyhf{ } %clear header and footer\lhead{\parbox{3.5cm}{First Name\\Last Name\\ID}}\begin{document}hi\end{document}结果如下: 阅读全文
posted @ 2013-10-06 02:58 Joyce-Lee 阅读(1463) 评论(0) 推荐(0) 编辑