自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 delete void* 释放内存问题(C++)

有时候我们可能遇到将一个指向一块堆内存的类型指针转为 void* 类型的情况,这时候如果直接 delete void* 会出现什么情况呢?我们先用一段代码说明问题:class mycalss{public: mycalss() : data(new int[100]){} ~mycalss() { delete[] data; }private: int *data;}

2015-12-30 13:49:19 8166 2

原创 Effective C++ 一个简单的 String 类的 Reference Counting 实现(C++)

// Reference-counting pointertemplateclass RCPtr{public: RCPtr(T* realPtr = nullptr); RCPtr(const RCPtr& rhs); ~RCPtr(); RCPtr& operator = (const RCPtr& rhs); T* operator-> () const; T& ope

2015-12-10 14:09:18 499

原创 LeetCode(92): Reverse Linked List II (C++)

一、题目Reverse a linked list from position m ton. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL,m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satis

2015-12-03 15:14:13 542

原创 LeetCode(60): Permutation Sequence (C++)

一、题目The set[1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""2

2015-12-01 10:44:16 1028

原创 LeetCode(46): Permutations (C++)

一、题目    Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2],[2,1,3], [2,3,1], [3,1,2], and [3,2,1].二、

2015-12-01 10:00:16 1771

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除