N hasn't done any WinForm program about C # For a long time, and has been studying asp.net programs.
Today, a friend asked me a question like deep graph traversal. At first I didn't know how to start. I asked baidu and google, and I saw an example written in C ++, by the way, I learned about it and found that I forgot about it (including: Data Structure). I can only think of the first Hello Worl example I learned when I first started learning vs2003, create a console application.
Next, open VS2005 and create a new project.> Project> console application.
The Code is as follows:
Code 1 using System;
2 using System. Collections. Generic;
3 using System. Text;
4 using System. Collections;
5
6 namespace ConsoleApplication2
7 {
8 class Program
9 {
10 static void Main (string [] args)
11 {
12 Graph graph = new Graph ();
13 graph. addVertex ();
14 graph. addVertex (B );
15 graph. addVertex (C );
16 graph. addVertex (D );
17 graph. addVertex (E );
18 graph. addVertex (F );
19 graph. addVertex (G );
20 graph. addVertex (H );
21 graph. addEdge (A, B );
22 graph. addEdge (B, D );
23 graph. addEdge (B, E );
24 graph. addEdge (E