自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(38)
  • 收藏
  • 关注

转载 Matrix Cells in Distance Order

Matrix Cells in Distance OrderWe are given a matrix with R rows and C columns has cells with integer coordinates (r, c), where 0 <= r < R and 0 <= c < C.Additionally, we are given ...

2019-07-22 15:22:00 167

转载 Relative Sort Array

Relative Sort ArrayGiven two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.Sort the elements of arr1 such that the relative ordering of ite...

2019-07-20 22:18:00 133

转载 Median of Two Sorted Arrays

Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m...

2019-07-19 16:55:00 132

转载 Longest Substring Without Repeating Characters

3.Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The an...

2019-07-16 17:08:00 92

转载 Add Two Numbers

Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two...

2019-07-15 23:30:00 75

转载 Two Sum

Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not ...

2019-07-14 16:45:00 65

转载 MacBook Pro配置汇编开发环境

配置开发环境方法一:打开命令行,输入指令which nasm查看nasm的安装路径,Mac系统默认安装了nasm.一般默认返回的路径是/usr/bin/nasm接着输入指令alias nasm=/usr/bin/nasm输入指令nasm -v如果配置成功的话,就会返回nasm的版本号NASM version 2.14.02 compiled on Dec 27 2018,如果...

2019-05-08 21:24:00 368

转载 STL中的函数对象实现负数的定义

//// main.cpp// STL中的函数对象//// Created by mac on 2019/5/2.// Copyright © 2019年 mac. All rights reserved.// 1.是否支持模版继承?// 2.模版中存在多个参数?#include <iostream>#include <functiona...

2019-05-03 00:01:00 112

转载 重载赋值运算符

//// main.cpp// 运算符重载(Overloading)// 默认复制构造函数(Default Copy Constructor)// Created by mac on 2019/4/29.// Copyright © 2019年 mac. All rights reserved.// 析构函数是一个成员函数,当对象被销毁时,该函数被自动调用。//...

2019-05-02 20:50:00 139

转载 静态成员函数和(CPP与C结构体的区别)

#include <iostream>using namespace std.;//这种写法只是CPP中的struct的用法,但是在C中还是不支持的。//C中的结构体不支持写方法的。struct A{private: int a;public: void setA(int A){a=A;} int getA()const{return a...

2019-05-02 16:28:00 121

转载 this 指针

//// main.cpp// this指针//// Created by mac on 2019/5/2.// Copyright © 2019年 mac. All rights reserved.// 默认情况下,编译器为类的每个成员函数提供了一个隐式形参,该隐式形参成为this#include <iostream>using namespa...

2019-05-02 16:04:00 79

转载 静态成员变量 与 静态成员函数

//// main.cpp// 静态成员变量// 静态成员函数// Created by mac on 2019/4/29.// Copyright © 2019年 mac. All rights reserved.// 如果一个成员变量被声明为static,那么该类的所有对象都可以访问该变量。// 如果一个成员函数被声明为static,那么他可以在类的任何实...

2019-04-29 20:42:00 102

转载 从后往前冒泡

//// main.cpp// test// 随便写的// Created by mac on 2019/4/18.// Copyright © 2019年 mac. All rights reserved.//#include <iostream>#include <list>#include <vector>#inc...

2019-04-18 18:45:00 102

转载 蓝牙

蓝牙USB-Dongle使用教程https://wenku.baidu.com/view/55f33d6b0722192e4436f634.htmlhttps://wenku.baidu.com/view/d6b7104043323968011c92b6.html?rec_flag=defaulthttps://blog.csdn.net/viewtool2017/article...

2019-04-17 01:59:00 75

转载 复制构造函数传递的是引用而非指针

//// main.cpp// 复制构造函数//// Created by mac on 2019/4/11.// Copyright © 2019年 mac. All rights reserved.//#include <iostream>#include <typeinfo>#include <type_traits>...

2019-04-11 17:51:00 129

转载 指向成员函数的指针

//// main.cpp// testvoidmain//// Created by mac on 2019/4/11.// Copyright © 2019年 mac. All rights reserved.// 1.只有成员函数才能有const限定符// 2.脑袋怎么总是混乱// 3.在类内部定义指向函数的指针有点蠢?#include <i...

2019-04-11 16:27:00 66

转载 函数对象与复制构造函数

//// main.cpp// functionObj// 函数对象// 1.函数调用运算符(),这个运算符支持重载。// 2.()运算符能够返回任何类型,可以使用任何数量的参数,但是跟赋值运算符一样,只能重载为成员函数。// 3.函数对象也是对象,只是他的行为表现的像函数而已。当调用函数对象时,其参数是函数调用运算符的参数// 4.复制构造函数仅在创建对象并初始化对...

2019-04-11 12:34:00 105

转载 二维数组降维为一维数组

//// main.cpp// 二维数组// 1.一个二维数组就像是若干个相同的数组放在一起,这对于存储多组数据非常有用。// 2.一维数组(One-Dimension Array)// 3.二维数组(Two-Dimension Arrays)// 4.处理二维数组的时候直接当作一维数组就可以了每一行都是一个一维数组。// 5.二维数组在存储的时候,是按照一行...

2019-04-10 15:00:00 2377

转载 指向函数的指针与指向函数的引用

//// main.cpp// 函数指针// Created by mac on 2019/4/9.// Copyright © 2019年 mac. All rights reserved.// 函数指针的定义:double (*f) (double) ,f是一个指向函数的指针,该函数带有一个double类型的参数,而且会返回一个double的值。// 函数引用...

2019-04-09 18:58:00 189

转载 自增运算符

//// main.c// c自增运算符//// Created by mac on 2019/4/9.// Copyright © 2019年 mac. All rights reserved.//#include <stdio.h>int main(int argc, const char * argv[]) { int count=1...

2019-04-09 16:21:00 121

转载 函数的返回值是void

#include <stdio.h>void sub(int x,int y,int z){ z=y-x;}void main() { int a=1,b=2,c=3; sub(10,5,a); sub(8,a,b); sub(a,b,c); printf("%d%d%d",a,b,c);}输出结果123Pr...

2019-04-09 14:23:00 652

转载 析构函数的调用

// main.cpp// 构造函数析构函数练习// Created by mac on 2019/4/8.// Copyright © 2019年 mac. All rights reserved.// 1.编译器总是在调用派生类构造函数之前调用基类的构造函数// 2.派生类的析构函数会在基类的析构函数之前调用。// 3.析构函数属于成员函数,当对象被销毁时,...

2019-04-08 20:24:00 326

转载 友元函数破坏信息隐藏性

//// main.cpp// friendFunction// 1. 静态成员变量需要在类中声明,在类外定义。// 2. 友元函数相当于成员函数,可以访问私有变量,破坏信息的隐藏性。// 3. 模版类的的静态成员变量的定义与声明。// Created by mac on 2019/4/8.// Copyright © 2019年 mac. All rights r...

2019-04-08 18:08:00 498

转载 OOP 多态/虚函数

// main.cpp// OOP// 虚函数允许继承层次结构中绝大多数特定版本的成员函数被选择执行,虚函数使多态成为可能。// Created by mac on 2019/4/8.// Copyright © 2019年 mac. All rights reserved.#include <iostream>using namespace std;...

2019-04-08 14:46:00 171

转载 函数的返回类型是引用类型与函数的返回类型是指针类型

//// main.cpp// 引用类型指明函数的返回类型// 指针类型指明函数返回指针类型// Created by mac on 2019/4/7.// Copyright © 2019年 mac. All rights reserved.#include <iostream>using namespace std;//函数的返回值是个引用i...

2019-04-07 16:16:00 250

转载 类模版与函数模版

//// main.cpp// 类模版与函数模版// 在类声明中使用类型参数来声明通用的类// Created by mac on 2019/4/6.// Copyright © 2019年 mac. All rights reserved.// 一个类模版中是否支持多种类型的参数?--可以的// 在algorithm下已经写过swap函数了,所以自己再用swa...

2019-04-06 16:53:00 53

转载 指针常量与常量指针

//// main.cpp// pointer// 指针常量与常量指针// 不管是指针常量还是常量指针其本质都是指针,所以他们需要赋值的是一个地址。// 很多时候利用指针进行输出的时候 总是输出指针的地址了,经常性的忘记需要输出指针地址中的内容。// const int *还是int const * 都是指针常量 ,那常量指针怎么写法?常量指针是在int 与 co...

2019-04-06 15:12:00 62

转载 CPP strcat函数使用

strcat函数原型char * strcat ( char * destination, const char * source );strcat常见写法// main.cpp// 字符数组strcat()函数的使用// char * strcat ( char * destination, const char * source );// 来源的头文件 #inc...

2019-04-05 16:00:00 278

转载 循环读取数组元素的3种写法

// main.cpp// array// Created by mac on 2019/4/4.// Copyright © 2019年 mac. All rights reserved.// 循环读取数组元素的3种写法#include <iostream>using namespace std;int main(int argc, const cha...

2019-04-04 20:19:00 793

转载 指针变量图解

// main.cpp// 指针// Created by mac on 2019/4/4.// Copyright © 2019年 mac. All rights reserved.// 1.指针变量只用于存储内存地址,根据内存地址去查找里面存储的数据。#include <iostream>using namespace std;in...

2019-04-04 19:20:00 177

转载 CPP/类/成员函数访问权限2

// main.cpp// OOL// Created by mac on 2019/4/4.// Copyright © 2019年 mac. All rights reserved.// 1.在一个类中如果直接把成员函数权限声明成protected或者是private是无法直接被生成的本类对象访问的.// 2.如果想要访问被protected或者private保...

2019-04-04 18:23:00 158

转载 CPP/类/成员函数访问权限

转载于:https://www.cnblogs.com/overlows/p/10654736.html

2019-04-04 14:38:00 213

转载 字符指针用字符串初始化

转载于:https://www.cnblogs.com/overlows/p/10654602.html

2019-04-04 14:18:00 1199

转载 数据结构-树

B+树与B-树B-树和B+树都是平衡的多叉树B-树和B+树都可用于文件的索引结构B-树和B+树都能有效地支持随机检索转载于:https://www.cnblogs.com/overlows/p/10561365.html...

2019-03-19 21:07:00 38

转载 sizeof 用于返回一个对象或者类型所占据的内存数

整数类型sizeof(int);4字节or8字节函数sizeof(函数);函数返回值类型占据的字节数字符数组char c[] = "abc";sizeof(c);3+1=4整数数组int a[3];sizeof(a);3*4=12 or 3*8=24参考文献https://zhidao.baidu.com/question/19171773.html...

2019-03-12 17:31:00 294

转载 汽车加油问题

汽车加油问题转载于:https://www.cnblogs.com/overlows/p/10170640.html

2018-12-24 19:54:00 112

转载 The score of 'O' and 'X'

题目描述注意要点:使用strlen函数注意加头文件#inlcude <cstring>循环宏定义for循环#define _for(i,a,b) for(int i=(a);i<(b);++i)代码实现#include <iostream>#include <stdio.h>#include <stdlib.h>...

2018-11-26 19:18:00 113

转载 万年历

题目描述实现思路利用蔡勒公式计算代码实现#include <iostream>#include <cstdlib>#include<cmath>using namespace std;int main(){ string input; cin>>input; int first_=input.fi...

2018-11-19 22:48:00 58

空空如也

空空如也

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

TA关注的人

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