说一说虚拟地址空间有哪些部分
https://www.nowcoder.com/questionTerminal/0241d99ea91d479a8019579e40056afd
内核空间+用户空间,多线程分支的时候,就有那个,读同写异
不能是虚函数的函数
构造函数:需要提前直接实例化
内联函数:编译期直接要用
普通函数(肺类成员函数):不能被继承
友元函数:不能被继承
C++11新特性
auto类型推导
declatype类型推导
四种cast类型转换
智能指针
try_catch抛出异常
lamada表达式
给定一棵二叉树,分别按照二叉树先序,中序和后序打印所有的节点。
class Solution {
public:
/**
*
* @param root TreeNode类 the root of binary tree
* @return int整型vector<vector<>>
*/
vector<vector<int> > threeOrders(TreeNode* root) {
// write code here
vector<vector<int>> res;
order(root);
res.push_back(pre);
res.push_back(mid);
res.push_back(end);
return res;
}
void order(TreeNode* root){
if(root==NULL) return;
pre.push_back(root->val);
order(root->left);
mid.push_back(root->val);
order(root->right);
end.push_back(root->val);
}
private:
vector<int> pre;
vector<int> mid;
vector<int> end;
};