随笔分类 -  数据结构与算法

摘要://欢迎指正!!!////有向图找环//输入n条边 const int maxvex = 500; int graph[maxvex][maxvex] = {0};//邻接矩阵 set<int>vexs;//顶点容器 bool visitted[maxvex] = {false};//访问数组 ve 阅读全文
posted @ 2020-08-16 18:32 卡冈图雅blackhole 阅读(492) 评论(0) 推荐(0)
摘要:struct Node { int val; Node* next; Node* random; Node(int x, Node* pt1, Node* pt2) :val(x), next(pt1), random(pt2) {} }; class Solution { public: Node 阅读全文
posted @ 2020-08-12 11:52 卡冈图雅blackhole 阅读(166) 评论(0) 推荐(0)
摘要:struct BinaryTreeNode { int nvalue=0; BinaryTreeNode* pleft = nullptr; BinaryTreeNode* pright = nullptr; BinaryTreeNode* parent = nullptr;};准备一个队列,通过不 阅读全文
posted @ 2020-07-18 18:22 卡冈图雅blackhole 阅读(155) 评论(0) 推荐(0)