Loading

上一页 1 ··· 5 6 7 8 9
摘要: tags: - algo 性质1: 左子树的深度等于右子树 左为满,右为完全 左子树的深度大于右子树 左为完全,右为满 一个完全二叉树的左右子树都是完全二叉树 不断递归之后 最后都是满二叉树 只剩一个节点 性质2: 可以和位运算进行结合 https://leetcode.cn/problems/co 阅读全文
posted @ 2024-05-17 19:36 big_shark 阅读(7) 评论(0) 推荐(0)
摘要: tags: - algo 如果回溯是在尾部 可以使用 recrusion(path + xxx) 来实现 无需使用额外的语句。 阅读全文
posted @ 2024-05-17 19:36 big_shark 阅读(15) 评论(0) 推荐(0)
摘要: tags: - algo 用于一定区间内的维护最大/最小值 单调队列 class Myqueue{ private: deque<int> dq; public: Myqueue(){} void Push(const int &num){ while (!dq.empty() && dq.back 阅读全文
posted @ 2024-05-17 19:36 big_shark 阅读(8) 评论(0) 推荐(0)
摘要: tags: - cpp - algo 接口网站 cppreference set unorder_set // unorder_set unorder_set<T> u_set; //insert u_set.insert(T t); // find and judge iterator it = 阅读全文
posted @ 2024-05-17 19:36 big_shark 阅读(14) 评论(0) 推荐(0)
摘要: tags: - cpp 什么是移动 c++ 中 = 的默认操作是拷贝 每次操作内存的时候都会进行拷贝操作。移动操作相当于数据的转移,原来存放数据的地方没有这个值了。 左值引用,右值引用 int val{ 0 }; int&& rRef0{ getTempValue() }; // OK,引用临时对象 阅读全文
posted @ 2024-05-17 19:36 big_shark 阅读(15) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9