E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
nullptr
剑指offer-树专题总结
常见技巧1、与二叉树有关的代码有大量指针操作,每次使用指针的时候,都要问自己有没有可能为
nullptr
,如果是该怎么处理。
suizuolanting
·
2020-09-16 10:37
自己实现一个
nullptr
,C++中不能将void*类型的指针隐式转换成其他指针类型,而又为了解决空指针的问题,所以C++中引入0来表示空指针,而又因为NULL不能提醒程序员它是一个整数0而不是一个指向0的空指针,所以又引入了
nullptr
QQ2651401966
·
2020-09-16 09:55
C和C++
树的两种非递归的先序遍历
*structTreeNode{*intval;*TreeNode*left;*TreeNode*right;*TreeNode():val(0),left(
nullptr
),right(
nullptr
all_about_WZY
·
2020-09-16 09:41
编程题
基础算法
【Qt】监视文件和目录的修改:QFileSystemWatcher
二、常用成员函数1、public构造、析构函数:QFileSystemWatcher(constQStringList&paths,QObject*parent=
nullptr
)QFileSystemWa
郭老二
·
2020-09-16 06:48
Qt
中文手册
Archicad二次开发——创建墙、梁、柱等元素
GSErrCodeerr;wallElement.header.typeID=API_ElemTypeID::API_WallID;ACAPI_Element_GetDefaults(&wallElement,
nullptr
niuge8905
·
2020-09-16 05:48
Archicad二次开发
Archicad二次开发——创建辅助元素
sizeof(API_Element));element.header.typeID=API_LineID;GSErrCodeerr=ACAPI_Element_GetDefaults(&element,
nullptr
niuge8905
·
2020-09-16 05:48
Archicad二次开发
C++ shared_ptr的模拟实现
include//这个头文件是用来使用互斥锁templateclassShared_ptr{public://构造函数Shared_ptr(T*_ptr=
nullptr
):ptr(_ptr),pcount
镜中月ss
·
2020-09-16 00:17
C++
c++
面试题35:复杂链表的复制
*Clone(ComplexListNode*pHead),复制一个复杂链表,在复杂链表中,每个节点除了有一个m_pNext指针指向下一个节点,还有一个m_pSibling指针指向链表中的任意节点或者
nullptr
Lix_Demon
·
2020-09-16 00:50
剑指Offer
链表
指针
单链表
C++ - 类成员初始化的一次实践
TrieNode的初始化实现有问题,严格来说,第一次的实现不是初始化,而是赋值,具体代码如下structTrieNode{TrieNode():count(0){for(auto&p:next){p=
nullptr
klbc
·
2020-09-15 23:10
C++
C++初始化
c++
C++ shared_ptr的实现
templateclassMySharedPtr{private:T*ptr=
nullptr
;//指针std::atom
木凡辰
·
2020-09-15 23:53
C++学习笔记
c++
智能指针
数据结构域算法————链表
数据域Node*pNext;//指针域,用于保存下一个节点的首地址};classList{//记录当前链表的节点个数intm_nCount=0;//用于保存链表的头节点的地址Node*m_pHead=
nullptr
小白菜。。。
·
2020-09-15 23:01
C++ 智能指针shared_ptr的实现
includeusingnamespacestd;templateclasssmart{private:T*_ptr;int*_count;//referencecoutingpublic://构造函数smart(T*ptr=
nullptr
hp_cpp
·
2020-09-15 23:28
C++
对unique_ptr与shared_ptr为
nullptr
时, 删除器的调用机制疑惑
先贴上代码:#include#includeautounique_deleter=[](int*p){std::coutpUniquePtr(
nullptr
,unique_deleter);//unique_ptr
清海风缘
·
2020-09-15 22:05
C++
【每日一题】83.删除排序链表中的重复元素
classSolution{public:ListNode*deleteDuplicates(ListNode*head){if(head==
nullptr
||head->next==
nullptr
)returnhea
ahojcn
·
2020-09-15 21:11
LeetCode
leetcode
链表
单链表
c++ 舞蹈链算法求解数独问题 控制台版本 带注释
#include#include#include#include#defineDELPOINTER(p)if(
nullptr
!
CoderZhuuu
·
2020-09-15 21:53
c++
算法
c++
舞蹈链算法
数独
C++字符串的截取,切割
VectorDelim:分割的条件*@return:*/staticvoidsplit(char*Content,std::vectorStrings,constchar*Delim){char*NextToken=
nullptr
Rock-
·
2020-09-15 21:20
C++
Qt for ios 暗黑模式
Xcode11#includeclassBackgroundColor:publicQObject{Q_OBJECTpublic:explicitBackgroundColor(QObject*parent=
nullptr
超奇电子
·
2020-09-15 19:15
QT
QML
leetcode 951. Flip Equivalent Binary Trees
classSolution{public:boolflipEquiv(TreeNode*root1,TreeNode*root2){if(root1==
nullptr
&&root2==
nullptr
)returntrue
Simon|
·
2020-09-15 16:40
LeetCode
C/C++ 函数指针变量 && 返回函数的函数
nullf=test1;//给该函数变量赋值f();//执行该函数变量return0;}2.给函数定义类型,方便编码时简洁的使用typedefint(*F_TYPE)();intmain(){F_TYPEf=
nullptr
feekia
·
2020-09-15 11:03
C++
C
linux
双递归二叉树 力扣1367二叉树中的列表 面试题04.10检查子树
problems/linked-list-in-binary-tree/classSolution{public:booldfs(ListNode*head,TreeNode*root){if(head==
nullptr
lucky tiger
·
2020-09-15 06:06
#
二叉树
#
递归
剑指offer面试题5:替换空格
#includeusingnamespacestd;voidReplaceBlank(charstring[],intlength){if(string==
nullptr
||lengthlength)return
Ther Meng
·
2020-09-15 06:36
字符串
golang
C++中的operator=运算符重载
类的定义部分:#includeusingnamespacestd;classMyString{private:char*m_pData;public:MyString(constchar*pData=
nullptr
蹦蹦跳跳小米粒
·
2020-09-15 06:56
C++
《剑指offer》面试题12:矩阵中的路径
classSolution{public:boolhasPath(char*matrix,introws,intcols,char*str){//首先要考察这个算法的鲁棒性if(matrix==
nullptr
Avada__Kedavra
·
2020-09-15 05:46
23. Merge k Sorted Lists(k个链表融合)
*structListNode{*intval;*ListNode*next;*ListNode():val(0),next(
nullptr
){}*ListNode(intx):va
汝之宿命
·
2020-09-15 05:33
leetcode
剑指offer面试题5:替换空格
classSolution{public:voidreplaceSpace(char*str,intlength){if(str==
nullptr
||lengthlength)return;intcopylength
虚心学习进步
·
2020-09-15 05:38
算法篇
剑指offer
Qt信号槽的四种写法
也有比较复杂的写法,为了理解其中的差异,不妨先定义个控件:classButton:publicQWidget{Q_OBJECTpublic:explicitMyButton(QWidget*parent=
nullptr
阿达和自己
·
2020-09-15 05:53
C++
Qt
数据结构-剑指offer-两个链表的第一个公共节点
classSolution{public: ListNode*FindFirstCommonNode(ListNode*pHead1,ListNode*pHead2){ if(pHead1==
nullptr
baidu_32936911
·
2020-09-15 04:05
未完全懂
数据结构
剑指offer
C
递归排序和归并排序算法及其复杂度分析以及小和问题
intj){inttemp=arr[i];arr[i]=arr[j];arr[j]=temp;}voidmerge(intarr[],intleft,intmiddle,intright){if(arr==
nullptr
Li_haiyu
·
2020-09-15 04:34
算法基础
C++ operator=的两种写法
classCMyString{public:CMyString(char*pData=
nullptr
);CMyString(constCMyString&str);~CMyString(void);CMyString
一纸一清风
·
2020-09-15 04:00
C++
C语言
两个链表一个升序一个降序,合并为升序链表
=
nullptr
){this->next->print();}
nudt_qxx
·
2020-09-14 08:40
Qt Tcp通讯客户端
include"ui_QtClientWidget.h"#includeclassQtClientWidget:publicQWidget{Q_OBJECTpublic:QtClientWidget(QWidget*parent=Q_
NULLPTR
芒种、
·
2020-09-14 02:57
Qt基础/高级
qt
继承与多态(三):使用虚函数实现多态
coutspeak();//用父类指针指向子类对象,调用虚函数,实现多态array[1]->speak();foreach(Mammal*ptrinarray){if(ptr){deleteptr;ptr=
nullptr
成都fly
·
2020-09-13 21:57
某外企c++面试题目
structTreeNode_t{intval;structTreeNode_t*left;structTreeNode_t*right;TreeNode_t(intval):val(val),left(
nullptr
草根caogen
·
2020-09-13 18:00
面试
关于 static auto x = []()的用法解析
前言在刷Leetcode的时候发现很多运算速度极快的代码都有这一段,所以研究一下.staticconstauto_=[](){ios::sync_with_stdio(false);cin.tie(
nullptr
weixin_42658928
·
2020-09-13 17:20
C/C++
std::ios::sync_with_stdio和tie()——给cin加速
Leetcode上刷题的时候,总能看到有一些题中最快的代码都有这样一段staticconstautoinit=[](){std::ios::sync_with_stdio(false);std::cin.tie(
nullptr
weixin_30535565
·
2020-09-13 14:07
大数据
c/c++
关闭对cstdio的兼容负担,释放c++流的原始性能,std::ios::sync_with_stdio(false)和std::cin.tie(
nullptr
)
turnoffc++streamsynchronizewithCstdiostd::ios::sync_with_stdio(false);//untiec++in/outstreamsstd::cin.tie(
nullptr
持续努力
·
2020-09-13 14:35
c++
关于ios::sync_with_stdio(false);和 cin.tie(0)加速c++输入输出流
加速c++输入输出流staticautospeedup={ios::sync_with_stdio(false);cin.tie(
nullptr
);returnnullptr;}();
小刀刺大熊
·
2020-09-13 14:43
C++
解析 static auto x = []() { std::ios::sync_with_stdio(false);std::cin.tie(
nullptr
);return 0;}()
staticconstautoio_sync_off=[](){//turnoffsyncstd::ios::sync_with_stdio(false);//untiein/outstreamsstd::cin.tie(
nullptr
BTT的自我进阶
·
2020-09-13 14:57
基础
解析static auto x=[]{ std::ios::sync_with_stdio(false); std::cin.tie(
nullptr
); return 0; }();
解析staticautox=[]{std::ios::sync_with_stdio(false);std::cin.tie(
nullptr
);return0;我在刷牛客网的题时,遇到了运行速度太大,查看了已提交的代码
大姐姐毕宿五
·
2020-09-13 14:36
C++
二叉树中和为某一值的路径
intmax_path(BitTreeb){if(b==
nullptr
)return0;inttemp1=b->data+max_path(b->left);inttemp2=b->data+max_path
sinat_27233737
·
2020-09-13 12:25
算法
C++11提供了创建匿名函数的能力,叫做Lamda函数
C++11提供了创建匿名函数的能力,叫做Lamda函数:std::functioncallback=
nullptr
;如果其他地方调用了if(_callback)_callback(&info);在他应用地方就是回调触发该事件
时间溜走了
·
2020-09-13 12:41
c++
命令dumpsys之gfxinfo调用流程
intargc,char*constargv[]){signal(SIGPIPE,SIG_IGN);spsm=defaultServiceManager();//1fflush(stdout);if(sm==
nullptr
givemefive_001
·
2020-09-13 09:26
安卓开发
实验11.1(最优前缀编码)
left,*right;intval,ID;stringcode;node(intval,intID){this->ID=ID;this->val=val;this->left=this->right=
nullptr
css_is_awesome
·
2020-09-13 08:36
哈夫曼编码C++
includeusingnamespacestd;structNode{intkey;Node*lchild,*rchild;stringcode="";Node(intk){key=k;lchild=rchild=
nullptr
阿木木式骑士
·
2020-09-13 07:20
算法
C++实现单链表
**1.代码**single_list.cpp#include//节点类templatestructnode{Tdata;node*m_pnext;node(){data=T();m_pnext=
nullptr
祝云飞
·
2020-09-13 07:50
C及C++
单链表
漫谈C++11多线程内存模型v
11feelslikeanewlanguage”-BjarneStroustrup的确,C++11核心已经发生了巨大的变化,它现在支持Lambda表达式、对象类型自动推断、统一初始化语法、Deleted和Defaulted函数、
nullptr
wintree
·
2020-09-13 06:38
C/C++学习
unix/linux学习篇
centos 6 下编译gcc4.8.3
centos自带的gcc版本4.4.7版本太低,gcc4.6后才带
nullptr
这个常量,需要重新编译gcc4.8.3.1.下载gcc4.8.3wgethttp://ftp.gnu.org/gnu/gcc
rryqszq4
·
2020-09-13 02:18
c
链表面试题-单链表排序(冒泡,快速,归并)
结点类型structNode{//构造函数Node(intdata):_next(
nullptr
),_data(data){}Node*_next;int_data;}冒泡排序:对于冒泡排序,想必任何一个程序猿都不会陌生
清枫若待佳人醉
·
2020-09-13 02:42
数据结构
C++ 11之 && 右值引用
_ptr=
nullptr
;}刚开始一阵犯晕,一个类型Ref和一个似乎是形参的other与操作会得出一个什么?显然这种理解是错误的。。“&&”还有一种含义是右值引用,表示形参是一个右值。
fenghen777
·
2020-09-13 01:40
C++
qt窗口居中显示
=
nullptr
);QPointlast_new_window_pos_;constQRectgeometry=desktop->availableGeometry(QCursor::pos());if
没用的阿_吉
·
2020-09-12 23:08
Qt
Create
qt
上一页
38
39
40
41
42
43
44
45
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他