传统弱校HFUT的蒟蒻,真相只有一个

04 2020 档案

摘要:leetcode 面试题51. 数组中的逆序对 本质上就是归并排序,并在合并区间过程中统计交换的逆序对的数目 归并排序需要开o(n)的辅助空间 class Solution { public: int deal(vector<int>&nums,vector<int>&tmp,int ll,int 阅读全文
posted @ 2020-04-26 12:24 未名亚柳 阅读(204) 评论(0) 推荐(0) 编辑
摘要:一、不能被继承的类 构造函数析构函数定义为 private public中定义static函数调用构造函数析构函数 class Sealed_classes { public: static Sealed_classes* getnew() { return new Sealed_classes() 阅读全文
posted @ 2020-04-09 16:10 未名亚柳 阅读(150) 评论(0) 推荐(0) 编辑
摘要:一、示例,数组存储在内存的栈区,栈还会存函数入口地址等信息,test()调用结束以后会释放ch的存储区, 因此可以看到p没有存到内容。 char * test() { char ch[]="hello"; cout<<"$:"<<&ch<<endl; return ch; } int main() 阅读全文
posted @ 2020-04-01 20:27 未名亚柳 阅读(237) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示