Wednesday, May 11, 2016

HackerRank – Connected Cell in a Grid - Warm up with Five Practices (V)

May 11, 2016


Being a software programmer, it is easy to spend hours to read and catch up technologies, work on new algorithm, but no coding, one day, or one week, even half month/ month. 

So, warm up like sports. Julia chose the algorithm - Connected Cell In a Grid to warm up for a few hours. 

Last time, less than 1 month ago, Julia did work on this algorithm – connected cell in a grid. And then, she started to warm up again.

Here is one of blogs last practice on April 16, 2016:

Fifth practice, using stack instead of recursive function, implement the DFS algorithm:

Question and Answer:

1. What do you like the approach - using stack, DFS algorithm? 

To write using stack is similar to using queue, but the search is DFS instead of BFS. Julia does not have time to build a test case to compare the order of visited nodes this time. 

No comments:

Post a Comment