life is too short for a diary

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [a_{i}, b_{i}] indicates that you must take course b_{i} first if you want to take course a_{i}...

Continue reading → leetcode graph bfs java python

Graph are data structures made of vertices & edges. There are lots of interesting problems that can be solved using graphs. Part 1 covers the basic for creating a template for graph data structure...

Continue reading → graph java implementation