- 博客(26)
- 资源 (15)
- 问答 (1)
- 收藏
- 关注
原创 leetcode——Decode Ways
题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the t
2014-11-27 16:34:18 545
原创 leetcode——Symmetric Tree
题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3
2014-11-26 17:29:02 562
原创 leetcode——Triangle
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3
2014-11-26 16:41:16 545
原创 leetcode——Best Time to Buy and Sell Stock
题目:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
2014-11-26 11:24:43 553
原创 leetcode——Scramble String
题目:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \
2014-11-24 15:40:18 501
原创 leetcode——Scramble_String
题目:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great
2014-11-24 15:22:55 569
原创 leetcode——Recover Binary Search Tree
题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could
2014-11-24 15:12:32 663
原创 leetcode——MinimumPathSum
题目:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or
2014-11-22 10:45:28 533
原创 leetcode——Word Break
题目:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict
2014-11-21 15:22:58 620
原创 leetcode——Combination Sum II
题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in th
2014-11-20 13:32:30 518
原创 leetcode——Reverse Nodes in k-Group
题目:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain
2014-11-19 13:36:15 546
原创 leetcode——Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of
2014-11-18 11:13:40 527
原创 leetcode——Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.E
2014-11-17 15:15:18 605
原创 Scala——函数式
def fibonacci(in: Any): Int = in match { case 0 => 0 case 1 => 1 case n: Int => fibonacci(n - 1) + fibonacci(n - 2) case _ => 0}println(fibonacci(3))//println(fibonacci(-3))//prin
2014-11-16 21:47:22 596
原创 Scala——基础篇
一、表达式和值在Scala中,几乎所有的语言元素都是表达式。println("hello wolrd")是一个表达式,"hello"+" world"也是一个表达式。可以通过val定义一个常量,亦可以通过var定义一个变量,推荐多使用常量。
2014-11-16 21:12:26 561
转载 精选85条Linux系统管理员知识点
不错的知识总结,内容涵盖磁盘、文件系统及网络管理常用命令。花十分钟浏览一下即可获取全方位Linux基础知识。说不定什么时候就用上了呢?(内容来自网络)1.在Linux系统中,以 文件 方式访问设备 。 2. Linux内核引导时,从文件 /etc/fstab 中读取要加载的文件系统。 3. Linux文件系统中每个文件用 inode 来标识。 4. 全部磁盘块由四个部分组成,分
2014-11-15 00:47:02 582
转载 危险代码:如何使用Unsafe操作内存中的Java类和对象—Part4
字段布局和对齐和C/C++不同,Java没有 sizeOf 运算符计算基本数据类型类型或对象所占用的内存空间,sizeOf 运算符在IO操作和内存管理中非常实用。事实上,由于基本数据类型的大小在语言规范中预先定义,Java中也不会出现指针拷贝内存和指针运算(因为没有指针)。因此,sizeOf 运算符并没有存在的必要。有两种方法能够确定一个类及其属性共占用了多少内存空间。分别是浅尺寸
2014-11-15 00:29:22 689
转载 线程池实例:使用Executors和ThreadPoolExecutor
线程池负责管理工作线程,包含一个等待执行的任务队列。线程池的任务队列是一个Runnable集合,工作线程负责从任务队列中取出并执行Runnable对象。java.util.concurrent.executors 提供了 java.util.concurrent.executor 接口的一个Java实现,可以创建线程池。下面是一个简单示例:首先创建一个Runable 类:W
2014-11-15 00:14:59 682
转载 给年轻程序员的建议
偶尔的,我会被人问道:如何成为一名优秀的程序员,更或者,如何成为一名程序员。每次人们问起,我都力图给出不同的答案。因此,我的答案是各种各样的。下面就是我认为的成为一名优秀的程序员需要做的一些事情。记住,想成为一名程序员,很多条路可走,这里列出的只是我的方法。 1. 解决你自己的问题 ― 从外面获取答案和自己解决问题、找到答案,这两种方式是有区别的。当你自己解决一个问题
2014-11-13 23:49:02 400
原创 leetcode ——Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as
2014-11-11 22:27:05 770
原创 git常用命令
【Create】git init 当前工程创建git版本库touch README 创建文件Readme在目录git add READMEecho "out">.gitignore 覆盖式修改忽略清单.gitignore 记录着上传过程中所需要忽略的文件,一般是工程的配置文件等。echo 为覆盖式写。git add * 添加到上传目录
2014-11-05 16:52:22 520
原创 leetcode——Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3
2014-11-03 13:30:01 629
原创 leetcode——LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if
2014-11-02 22:46:02 584
spring4.0.0.RELEASE全套jar包
2015-06-05
lucene 3.0.1 jar包
2015-01-09
一个音乐网站爬虫
2014-08-27
ja v a 泛型中的擦除问题
2014-11-24
TA创建的收藏夹 TA关注的收藏夹
TA关注的人