Saturday, January 6, 2018

Linear scan algorithm

January 6, 2018

Introduction


I had a mock interview 10:00 AM and the algorithm is to find the duplicate. I only wrote the code for one of two cases, using linear scan algorithm.

Code review


Here is C# code. The peer asked me what is LINQ, so I spent a few minutes to find the stackoverflow post and shared him the solution to use IEnumerable.ToArray().


No comments:

Post a Comment