上一页 1 2 3 4 5 6 7 8 ··· 15 下一页
摘要: Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solv... 阅读全文
posted @ 2015-07-19 19:02 朱传林 阅读(122) 评论(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-07-17 18:31 朱传林 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.取中间的结点作为根结点即平衡二叉树/** * Definition for a binary tree n... 阅读全文
posted @ 2015-07-17 17:03 朱传林 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-07-17 16:46 朱传林 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1。目录map简介map的功能map的定义在map中添加元素查找并获取map中的元素从map中删除元素map对象的迭代遍历2。map简介map是一类关联式容器,它是模板类。关联的本质在于元素的值与某个特定的键相关联,而并非通过元素在数组中的位置类获取。它的特点是增加和删除节点对迭代器的影响很小,除了... 阅读全文
posted @ 2015-07-17 15:07 朱传林 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-07-17 10:03 朱传林 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ... 阅读全文
posted @ 2015-07-16 14:48 朱传林 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o... 阅读全文
posted @ 2015-07-14 08:42 朱传林 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep... 阅读全文
posted @ 2015-07-13 16:00 朱传林 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... 阅读全文
posted @ 2015-07-10 09:26 朱传林 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 15 下一页