C++ 98的 std::auto_ptr已经被彻底遗弃了,取而代之的是unique_ptr、shared_ptr与weak_ptr。大部分时候我们自己手动申请内存方式内存都是没有问题的,问题是如果程序很大了之后,一个复杂的对象,多次拷贝的代价非常高,很多地方都会使用到,只存在一份拷贝显然是最好的,...
分类:
编程语言 时间:
2014-08-01 13:27:51
阅读次数:
384
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:之前做过一道是从sorted array转换到BinarySearc....
分类:
编程语言 时间:
2014-08-01 04:54:21
阅读次数:
310
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.算法:根据有序数组,生...
分类:
其他好文 时间:
2014-07-31 23:20:00
阅读次数:
270
Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A sol...
分类:
其他好文 时间:
2014-07-31 23:13:00
阅读次数:
223
生成Linq实体使用SPMetal工具生成Linq to SharePoint实体工具安装目录:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMETAL.exe命令参数:cmd:cdC:\P...
分类:
其他好文 时间:
2014-07-31 20:26:47
阅读次数:
310
题目:Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending o....
分类:
编程语言 时间:
2014-07-31 09:38:05
阅读次数:
341
题目:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must n....
分类:
编程语言 时间:
2014-07-31 05:22:45
阅读次数:
286
题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ....
分类:
编程语言 时间:
2014-07-31 05:21:55
阅读次数:
215
本文分别介绍了两种常用的添加ECB菜单项的方式。声明式创建这也是微软最佳实践推荐的方式。在VS中创建一个SharePoint空解决方案,并添加一个“空元素”类型的SPI。在Elements.xml中,定义一个CustomAction,重点关注一下其中高亮部分的属性(本例在文档内容类型的项上添加了一个...
分类:
其他好文 时间:
2014-07-31 02:29:15
阅读次数:
314
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...
分类:
其他好文 时间:
2014-07-31 02:19:45
阅读次数:
243