积少成多

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页

2016年6月28日

摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-06-28 22:01 x7b5g 阅读(124) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2016-06-28 21:49 x7b5g 阅读(194) 评论(0) 推荐(0) 编辑

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2016-06-28 17:25 x7b5g 阅读(213) 评论(0) 推荐(0) 编辑

2016年6月27日

摘要: 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 longes 阅读全文
posted @ 2016-06-27 23:16 x7b5g 阅读(159) 评论(0) 推荐(0) 编辑

摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2016-06-27 23:09 x7b5g 阅读(202) 评论(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 wit 阅读全文
posted @ 2016-06-27 22:29 x7b5g 阅读(169) 评论(0) 推荐(0) 编辑

摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2016-06-27 21:48 x7b5g 阅读(181) 评论(0) 推荐(0) 编辑

2016年6月26日

摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 利用:中序+后序遍历 c 阅读全文
posted @ 2016-06-26 22:50 x7b5g 阅读(144) 评论(0) 推荐(0) 编辑

摘要: Given preorder and inorder traversal of a tree, construct the binary tree. 基本功: 利用前序和中序构建二叉树 , code 阅读全文
posted @ 2016-06-26 22:46 x7b5g 阅读(218) 评论(0) 推荐(0) 编辑

摘要: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, ex 阅读全文
posted @ 2016-06-26 22:44 x7b5g 阅读(171) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页