From 98844eccedfb84fac46c83d59a1298cce491f77b Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 5 Jan 2017 00:26:34 -0500 Subject: Switch to unordered maps and sets --- src/graph.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/graph.h') diff --git a/src/graph.h b/src/graph.h index 7d0ae08..f687ff3 100644 --- a/src/graph.h +++ b/src/graph.h @@ -1,7 +1,9 @@ #ifndef GRAPH_H #define GRAPH_H -#include +#include +#include +#include #include class Graph { @@ -33,10 +35,11 @@ public: bool has_out_edges(int vertex) const { return has_out_edges_.count(vertex) > 0; } + private: std::set vertices_; - std::map> graph_; - std::set has_out_edges_; + std::unordered_map> graph_; + std::unordered_set has_out_edges_; }; #endif -- cgit v1.2.3