Search code examples
c#listlambdacomputer-sciencelinear-search

Lambda Search VS Linear Search


When I was debugging a lambda-based search, I noticed that it simply went through the list linearly, so it made we wonder if there was any advantage to doing a lambda search on a list in C# versus coding your own type-checking linear search on the same list.


Solution

  • Lambda method performs a linear search; therefore, the method is an O(n) operation, where n is Count.

    For more detailed on Lambda read these link Lambda Search