随笔分类 -  C++代码实现

摘要:BFS 典型搜索树示意图 // 计算从起点 start 到终点 target 的最近距离 int BFS(Node start, Node target) { std::queue<Node> q; // 核心数据结构 std::set<Node> visited; // 避免走回头路 q.push 阅读全文
posted @ 2021-12-21 01:38 Clovran-Wong 阅读(36) 评论(0) 推荐(0) 编辑
摘要:树结构 1.二叉搜索树 typedef int DataType; struct TreeNode { DataType data; std::shared_ptr<TreeNode> left_node; std::shared_ptr<TreeNode> right_node; TreeNode 阅读全文
posted @ 2021-12-14 18:23 Clovran-Wong 阅读(100) 评论(0) 推荐(0) 编辑
摘要:单例模式 #pragma once template<typename T> class Singleton { public: Singleton() = default; ~Singleton() = default; Singleton(const Singleton&) = delete; 阅读全文
posted @ 2021-12-14 00:04 Clovran-Wong 阅读(39) 评论(0) 推荐(0) 编辑

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