linux3% valgrind ./test1.out ==12395== Memcheck, a memory error detector ==12395== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==12395== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==12395== Command: ./a.out ==12395== Dump out graph (size = 5): [ 0]: 1 4 3 [ 1]: 2 0 4 [ 2]: 4 1 [ 3]: 0 4 [ 4]: 2 0 1 3 The neighbors of vertex 4 are: 2 0 1 3 The edges in the graph are: (0, 1) (0, 4) (0, 3) (1, 2) (1, 4) (2, 4) (3, 4) ==12395== ==12395== HEAP SUMMARY: ==12395== in use at exit: 0 bytes in 0 blocks ==12395== total heap usage: 15 allocs, 15 frees, 264 bytes allocated ==12395== ==12395== All heap blocks were freed -- no leaks are possible ==12395== ==12395== For counts of detected and suppressed errors, rerun with: -v ==12395== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6) linux3%