摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2016-03-16 13:26 哥布林工程师 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 阅读全文
posted @ 2016-03-16 13:14 哥布林工程师 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and 阅读全文
posted @ 2016-03-16 12:43 哥布林工程师 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). nvertical lines are drawn such that the two endpoi 阅读全文
posted @ 2016-03-16 12:09 哥布林工程师 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Given in-order [1,2,3] and pre-order [2,1,3], return a tree: 阅读全文
posted @ 2016-03-16 11:57 哥布林工程师 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Given inorder [1,2,3] and postorder [1,3,2], return a tree: 阅读全文
posted @ 2016-03-16 11:41 哥布林工程师 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is:[[2,4],[3,4],[ 阅读全文
posted @ 2016-03-16 08:29 哥布林工程师 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in Cwhere the candidate numbers sums to T. Each numb 阅读全文
posted @ 2016-03-16 06:41 哥布林工程师 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文
posted @ 2016-03-16 06:29 哥布林工程师 阅读(146) 评论(0) 推荐(0) 编辑
摘要: There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. T 阅读全文
posted @ 2016-03-16 05:18 哥布林工程师 阅读(174) 评论(0) 推荐(0) 编辑