04 2015 档案

摘要:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-04-29 10:29 mrpod2g 阅读(381) 评论(0) 推荐(0)
摘要:Description:Count the number of prime numbers less than a non-negative number,nReferences:How Many Primes Are There?Sieve of Eratosthenes由于一个合数总是可以分解成... 阅读全文
posted @ 2015-04-28 21:25 mrpod2g 阅读(136) 评论(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-04-25 20:40 mrpod2g 阅读(122) 评论(0) 推荐(0)
摘要:先找到这个文件:/home/user/.xsession-errors打开这个文件。这个文件记录了系统启动的日志,从这里你就可以看到启动的时候哪里出了问题。对于我的来说,问题出在这里:"mkdtemp: private socket dir: Permission denied"于是发现原来是昨天动... 阅读全文
posted @ 2015-04-23 21:41 mrpod2g 阅读(224) 评论(0) 推荐(0)
摘要:Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2015-04-23 21:01 mrpod2g 阅读(105) 评论(0) 推荐(0)
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2015-04-15 21:23 mrpod2g 阅读(133) 评论(0) 推荐(0)
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN... 阅读全文
posted @ 2015-04-12 19:42 mrpod2g 阅读(103) 评论(0) 推荐(0)
摘要:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2015-04-12 19:25 mrpod2g 阅读(157) 评论(0) 推荐(0)
摘要:Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl... 阅读全文
posted @ 2015-04-12 10:26 mrpod2g 阅读(154) 评论(0) 推荐(0)
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.用空间换时间的方法,先用一个数组将节点按序存放,然后建树,代码如下:/** * D... 阅读全文
posted @ 2015-04-10 21:19 mrpod2g 阅读(121) 评论(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 adjacent ... 阅读全文
posted @ 2015-04-09 16:03 mrpod2g 阅读(158) 评论(0) 推荐(0)
摘要: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 fol... 阅读全文
posted @ 2015-04-07 19:26 mrpod2g 阅读(148) 评论(0) 推荐(0)
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文
posted @ 2015-04-06 15:35 mrpod2g 阅读(151) 评论(0) 推荐(0)
摘要:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-04-02 08:45 mrpod2g 阅读(111) 评论(0) 推荐(0)