摘要:题目:知道一棵二叉树的前序序列、中序系列,打印出它的后序系列下面算法的时间复杂度:O(n^2) -- 最坏情况就是左单支树/* Kown the preorder listing and the inorder listing of a tree, print it's postorder listing*/void PrintPostOrder(const char *pre, int s1, int e1, const char *in, int s2, int e2){ if (s1 > e1 || s2 > e2) re...
阅读全文
04 2012 档案
摘要:1 异常规格(exception specification)用来指定某个函数可能抛出哪些异常,例如:void fun() throw(bad_alloc); //fun()只能丢出bad_alloc异常void fun() throw(); //fun()不抛出任何异常void fun() throw()(E1, E2, E3); //fun()只能丢出E1, E2, E3异常2 命名空间定义命名空间namespace uvsjoh { int a; void fun() { cout<< "uvsjoh::fun" << endl; }};nam
阅读全文

浙公网安备 33010602011771号