行云

行至水穷处,坐看云起时。

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

04 2012 档案

摘要:题目:知道一棵二叉树的前序序列、中序系列,打印出它的后序系列下面算法的时间复杂度: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... 阅读全文
posted @ 2012-04-10 21:31 windflying 阅读(503) 评论(0) 推荐(0)

摘要: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 阅读全文
posted @ 2012-04-06 13:45 windflying 阅读(247) 评论(0) 推荐(0)