Skip to content

Commit

Permalink
README code change
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosmaggioros authored Jul 2, 2024
1 parent 1287dfc commit f721784
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ int main(){
...
}

// And of course, every data structure that you need!

#include <graph.h>
weighted_graph<int> g("undirected");
g.add_edge(1, 4, 2);
g.add_edge(4, 5, 6);
g.add_edge(5, 2, 9);
g.add_edge(2, 8, 10);

// returns the shortest path from 1 to 2.
std::cout << g.shortest_path(1, 2) << '\n';
g.visualize() // You can visualize almost any of our implemented data structures!

// And of course, every data structure that you need!
int main(){
weighted_graph<int> g("undirected");
g.add_edge(1, 4, 2);
g.add_edge(4, 5, 6);
g.add_edge(5, 2, 9);
g.add_edge(2, 8, 10);

// returns the shortest path from 1 to 2.
std::cout << g.shortest_path(1, 2) << '\n';
g.visualize() // You can visualize almost any of our implemented data structures!
```
You can see more [examples](/examples) or follow the [Tutorials](/tutorial).
Expand Down

0 comments on commit f721784

Please sign in to comment.