Tuesday, July 11, 2017

Leetcode 547: Friends Circle

July 11, 2017

Plan to work on Leetcode 547: Friends Circle. The problem statement is here.

C# practice using depth first search is here.

JavaScript study code is here.

Algorithm talk 


It took Julia over 20 minutes to think about this medium algorithm. One thing Julia likes to do is to study over 10 implementations, and then write them using C# one by one. And also try to figure out the best way to identify the problem as a depth first search algorithm, and separate from advanced algorithm, time-consuming implementation.

Learn a few ideas of classical algorithm implementation, like disjoint set, union find algorithm. Review the past practice as well.

Study one of C++ solution, the link is here.
Write C# solution - link is here.

Disjoint set implementation in C#, link is here.

No comments:

Post a Comment