2016年1月27日

摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t... 阅读全文
posted @ 2016-01-27 06:22 一心一念 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of n integers, find the starting and ending position of a given target value.If the target is not found in the array, return [-1,... 阅读全文
posted @ 2016-01-27 04:10 一心一念 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.This matrix has the following properties:Intege... 阅读全文
posted @ 2016-01-27 03:38 一心一念 阅读(728) 评论(0) 推荐(0) 编辑

2016年1月22日

摘要: Given an integer array, heapify it into a min-heap array.For a heap array A, A[0] is the root of heap, and for each A[i], A[i * 2 + 1] is the left chi... 阅读全文
posted @ 2016-01-22 03:17 一心一念 阅读(478) 评论(0) 推荐(0) 编辑

2016年1月18日

摘要: Given n unique integers, number kExampleGiven [1,2,3,4], k = 2, target = 5. Return:[ [1,4], [2,3]]public class Solution { /** * @param A: an ... 阅读全文
posted @ 2016-01-18 07:32 一心一念 阅读(149) 评论(0) 推荐(0) 编辑

2016年1月16日

摘要: Singleton is a most widely used design pattern. If a class has and only has one instance at every moment, we call this design as singleton. For exampl... 阅读全文
posted @ 2016-01-16 06:45 一心一念 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a directed graph, design an algorithm to find out whether there is a route between two nodes.ExampleGiven graph:A----->B----->C \ | \ | ... 阅读全文
posted @ 2016-01-16 05:29 一心一念 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Given k strings, find the longest common prefix (LCP).ExampleFor strings "ABCD", "ABEF" and "ACEF", the LCP is "A"For strings "ABCDEFG", "ABCEFG" and ... 阅读全文
posted @ 2016-01-16 05:02 一心一念 阅读(183) 评论(0) 推荐(0) 编辑

2016年1月15日

摘要: Given two array of integers(the first array is array A, the second array is array B), now we are going to find a element in array A which is A[i], and... 阅读全文
posted @ 2016-01-15 07:03 一心一念 阅读(504) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins.If there is no cycle, return null.ExampleGiven -21->10->4->5, tail connects to node index ... 阅读全文
posted @ 2016-01-15 03:05 一心一念 阅读(95) 评论(0) 推荐(0) 编辑

导航