Benchmarking experiment 2

How much time does it take to find the index of the first occurrence of an item in a list such as collection?

When dealing with a list such as containers, it is very common to face a situation where we need to know the index of a given element in the collection. Here, we shall compare the following containers to see how efficient they are in this situation:

List<T>
C5.LinkedList<T>
C5.ArrayList<T>
C5.HashedArrayList<T>
C5.HashedLinkedList<T>
C5.TreeSet<T>

The approach remains the same as the previous task. The benchmarking code is as follows:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace PerformanceMap { class Program { static void Main(string[] args) { List<char> codes ...

Get .NET 4.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.