01 2015 档案

摘要:Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially... 阅读全文
posted @ 2015-01-30 22:42 birdhack 阅读(128) 评论(0) 推荐(0)
摘要:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni... 阅读全文
posted @ 2015-01-28 23:19 birdhack 阅读(129) 评论(0) 推荐(0)
摘要: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 @ 2015-01-27 20:41 birdhack 阅读(147) 评论(0) 推荐(0)
摘要:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions. 1 public class Solution { ... 阅读全文
posted @ 2015-01-23 22:05 birdhack 阅读(146) 评论(0) 推荐(0)
摘要:Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc... 阅读全文
posted @ 2015-01-23 00:20 birdhack 阅读(112) 评论(0) 推荐(0)
摘要:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?可以找规律 得出映射关系,(i,j)=... 阅读全文
posted @ 2015-01-21 22:54 birdhack 阅读(120) 评论(0) 推荐(0)
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2015-01-19 00:41 birdhack 阅读(167) 评论(0) 推荐(0)
摘要:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18]. 1 /** 2 * De... 阅读全文
posted @ 2015-01-16 22:40 birdhack 阅读(87) 评论(0) 推荐(0)
摘要:Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.... 阅读全文
posted @ 2015-01-15 23:40 birdhack 阅读(107) 评论(0) 推荐(0)
摘要:HDFS的主要特性 HDFS是基于流数据模式访问和处理超大文件的需求而开发的。HDFS主要特点 概括为以下几点:1.处理超大文件。超大文件通常是指数百MB、甚至数百TB大小的文件。2.检测和快速应对硬件故障。一般的HDFS系统是由数百台甚至上千台服务器组成,因此,故障检测和自动恢复是HDFS的一个... 阅读全文
posted @ 2015-01-15 00:13 birdhack 阅读(200) 评论(0) 推荐(0)
摘要:《java并发编程实战》读书摘要birdhack2015年1月2日对象的共享JAVA并发编程实战读书笔记 我们已经知道了同步代码块和同步方法可以确保以原子的方式执行操作,但一种常见的误解是,认为关键之synchronized只能用于实现原子性或者确定临界区。同步还有另一个重要的方面:内存可见性。... 阅读全文
posted @ 2015-01-15 00:09 birdhack 阅读(327) 评论(0) 推荐(0)
摘要:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-01-14 23:54 birdhack 阅读(239) 评论(0) 推荐(0)
摘要:HDFS是hadoop项目的核心子项目,是Hadoop主要的一个分布式文件系统。实际上,hadoop中有一个文件系统抽象,它提供了文件系统实现的各类接口,HDFS只是这个抽象文件系统的一个实例。文件系统 URI JAVA实现定义Localfilefs.LocalFileSystem本地文... 阅读全文
posted @ 2015-01-12 23:47 birdhack 阅读(242) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2015-01-12 21:59 birdhack 阅读(134) 评论(0) 推荐(0)
摘要:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.使用两个指... 阅读全文
posted @ 2015-01-12 21:23 birdhack 阅读(125) 评论(0) 推荐(0)
摘要:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT. 1 public class Solution { 2 public ... 阅读全文
posted @ 2015-01-11 23:05 birdhack 阅读(126) 评论(0) 推荐(0)
摘要:Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with ... 阅读全文
posted @ 2015-01-08 23:41 birdhack 阅读(125) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
posted @ 2015-01-07 22:42 birdhack 阅读(143) 评论(0) 推荐(0)
摘要:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret... 阅读全文
posted @ 2015-01-06 23:11 birdhack 阅读(116) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ... 阅读全文
posted @ 2015-01-05 22:28 birdhack 阅读(146) 评论(0) 推荐(0)
摘要:线程安全性1.什么是线程安全 在线程安全的定义中,最核心的概念是正确性。正确性的含义是,某个类的行为与规范完全一致。当对正确性有了一个比较清晰的定义后,就可以定义线程安全性:当多个线程访问某个类时,这个类始终能表现出正确的行为,那这个类就是线程安全的。 举例:无状态对象一定是线程安全的。 ... 阅读全文
posted @ 2015-01-02 23:20 birdhack 阅读(391) 评论(0) 推荐(0)
摘要:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文
posted @ 2015-01-01 20:43 birdhack 阅读(139) 评论(0) 推荐(0)
摘要:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-01-01 01:48 birdhack 阅读(120) 评论(0) 推荐(0)