Showing posts with label union find C# code. Show all posts
Showing posts with label union find C# code. Show all posts

Friday, May 5, 2017

Union Find Algorithm - one hour workout

May 5, 2017

Introduction


It is a good idea to have my own union find C# class and also put some test cases together for future use.

Here is the article to talk about union find in details on hackerearth.com.

Here is the blog to document the study on the topic.

Here is the blog to document more than one hour study on union find algorithm in world codesprint 10 contest.

Union Find Coding


It is in incognito mode, Julia did not share any code because she played the Rookie3 contest.

Follow up 



May 7, 2017 9:27am

Julia spent hours to test the union find algorithm, and planned to apply the algorithm to solve one of Rookie3 contest algorithms. She just applied the test case in less than one hour and solved the algorithm on Rookie3, score 25 point very easily. She did not have chance to look into the detail of the algorithm. 

May 10, 2017

Code review C# solution, and C# code is here

The path compression is implemented in the above algorithm. Every node's parent node is set to the root node of tree.



Saturday, January 21, 2017

Code Monk - Disjoint set union (Union find)

January 21, 2017

Julia got an email about the disjoint set union, and also she registered the test.

Basics of data structure - disjoint union set on hackerearth - a tutorial. Read the tutorial more than 30 minutes from 10:00am - 10:30am, Saturday, January 21, 2017.

Introduction

Finally, Julia found out some lecture note to help her think clearly, after more than 6 months, please see my previous blog - Roads in the Hacker land, word code sprint #4; over a few hours study, code review on Value of friendship, Julia worked on UnionSet class code review, blog link is here.

Code with unit test cases, study first (ID: yambe2002, ranking: 111/10432), link is here. Code review, link is here.

Hackerearth tutorial is well-prepared notes. So enjoyable to read the notes.

Workout plan

Julia understood that her time is limited, and also she pushes herself to attend contests as many as possible, try to put herself on constant pressure, therefore, she can perform better in the matches and also at work.

But, it also is important to get involved with others through community. She just noticed the difference since Nov. 25, 2016 when she joined the code review on stackexchange.com. It does not matter how many hours Julia dedicated herself to study one algorithm, she just needs to spend extra one hour to share with the community, people can benefit from her work, meanwhile she can get some feedback as well. As long as she continues to build credit and reputation on her work through the code review on stackexchange.com, she should enjoy learning process. Julia is no longer a lone worker, she learns to work better with others in the community.

Post the algorithm "value of friendship" question on code review website, link is here.

Study 13 questions posted by the user, reputation over 700, link is here.