- 博客(5)
- 收藏
- 关注
原创 C++ 类创建相关(构造函数、拷贝构造、赋值)
类对象构造1、分配内存空间 2、调用构造函数 初始化内存空间默认函数C++的空类,编译器会加入哪些默认的成员函数默认构造函数和拷贝构造函数析构函数赋值函数(重载赋值运算符=)构造函数 拷贝构造函数1. 构造函数不能为虚函数 To construct an object, a constructor needs the exact type of t...
2018-03-13 20:46:20
276
原创 c++ 单例模式
定义单例模也称单子模式,单件模式。通过该可以保证系统中只存在一个实例,并且提供全局访问使其被其他模块共享。打印机,窗口管理器,文件系统 等被共享的资源在系统中只有一个实例很重要。实现单例模式只能有一个实例,因此单例模式只能初始化一次 ,初始化后不能通过其他任何途径生成第二个实例。 c++类实例化的方式: 1. 构造函数 2. 拷贝构造函数 3. 复制函数 需要将以上...
2018-03-12 11:02:46
124
原创 Longest Consecutive Sequence
题目描述2.1.6 Longest Consecutive Sequence 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 longest con...
2018-03-06 18:14:59
120
原创 Median of two sorted Array
leetCodebook 2.1.5 Median of Two Sorted Arrays题目描述:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity s...
2018-03-06 16:48:14
175
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人