Implement Graph Leetcode Questions