摘要: 在C++中,众所周知在一个资源管理类(例如含有指向堆内存的指针)中需要重新定义拷贝构造函数、赋值运算符以及析构函数(Big Three),在新标准下还可能需要定义移动构造函数和移动赋值运算符(Big Five)。但实际上,这条规则还可以有一个小扩展。就是在资源管理类中,往往需要重新定义自己的swap 阅读全文
posted @ 2016-10-24 22:32 wangxiaobao1114 阅读(558) 评论(0) 推荐(2) 编辑
摘要: 题目: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determi 阅读全文
posted @ 2016-10-24 21:34 wangxiaobao1114 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string containing only digits, restore it by returning all possible valid IP address combinations. (Medium) For example:Given "25525511135 阅读全文
posted @ 2016-10-24 21:01 wangxiaobao1114 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. (Medium) For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, retur 阅读全文
posted @ 2016-10-24 20:56 wangxiaobao1114 阅读(176) 评论(0) 推荐(0) 编辑