-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph_algs.h
28 lines (18 loc) · 874 Bytes
/
graph_algs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef GRAPH_ALG_
#define GRAPH_ALG_
#include<vector>
#include "data_structs/base_struct.h"
namespace graph {
// https://leetcode-cn.com/problems/clone-graph/
graphNode* cloneGraph(graphNode* node);
// https://leetcode-cn.com/problems/course-schedule/
bool canFinish(int numCourses, std::vector<std::vector<int>>& prerequisites);
std::vector<std::vector<int>> create_adajct(int num, std::vector<std::vector<int>> & edges);
// https://leetcode-cn.com/problems/course-schedule-ii/
std::vector<int> findOrder(int numCourses, std::vector<std::vector<int>>& prerequisites);
// https://leetcode-cn.com/problems/minimum-height-trees/
std::vector<int> findMinHeightTrees(int n, std::vector<std::vector<int>>& edges);
// https://leetcode-cn.com/problems/network-delay-time/
int networkDelayTime(std::vector<std::vector<int>>& times, int N, int K);
}
#endif // GRAPH_ALG_