菱纱梦

导航

2014年9月14日 #

C++学习笔记 <multimap>

摘要: mutimap很想map,但是他允许重复的关键码iterator insert(const value_type&);//返回iterator,不是pair//无下标操作符[]equal_range()、lower_bound()和upper_bound()操作 是用一个关键码访问多重元素值的基本手... 阅读全文

posted @ 2014-09-14 19:57 菱纱梦 阅读(147) 评论(0) 推荐(0) 编辑

C++学习笔记 <map>

摘要: C++中关联数组是一种内部类型,也被称为映射(map)一个map就是一个(关键吗,值)的对偶序列,他提供基于关键码的快速提取操作map的关键吗具有唯一性map提供双向迭代器map的关键吗要提供一个小于操作,保持自己元素的有序性, 迭代通过map时,是按顺序的一个map就是一个pair的一个序列,ma... 阅读全文

posted @ 2014-09-14 14:36 菱纱梦 阅读(244) 评论(0) 推荐(0) 编辑

2014年9月13日 #

Flatten Binary Tree to Linked List <leetcode>

摘要: Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文

posted @ 2014-09-13 21:26 菱纱梦 阅读(147) 评论(0) 推荐(0) 编辑

2014年9月9日 #

Sum Root to Leaf Numbers <leetcode>

摘要: 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 @ 2014-09-09 20:25 菱纱梦 阅读(159) 评论(0) 推荐(0) 编辑

Combinations <leetcode>

摘要: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文

posted @ 2014-09-09 19:48 菱纱梦 阅读(156) 评论(0) 推荐(0) 编辑

Populating Next Right Pointers in Each Node II <leetcode>

摘要: Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil... 阅读全文

posted @ 2014-09-09 18:58 菱纱梦 阅读(140) 评论(0) 推荐(0) 编辑

Pascal's Triangle II <leetcode>

摘要: Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(... 阅读全文

posted @ 2014-09-09 10:58 菱纱梦 阅读(116) 评论(0) 推荐(0) 编辑

Path Sum <leetcode>

摘要: 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 @ 2014-09-09 10:27 菱纱梦 阅读(138) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted Array II <leetcode>

摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret... 阅读全文

posted @ 2014-09-09 09:53 菱纱梦 阅读(133) 评论(0) 推荐(0) 编辑

2014年9月8日 #

Binary Tree Level Order Traversal <leetcode>

摘要: Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2... 阅读全文

posted @ 2014-09-08 21:14 菱纱梦 阅读(151) 评论(0) 推荐(0) 编辑