Skip to content

Instantly share code, notes, and snippets.

@jasl
Forked from JeffreyZhao/List.cs
Created November 2, 2012 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasl/4000154 to your computer and use it in GitHub Desktop.
Save jasl/4000154 to your computer and use it in GitHub Desktop.
// As we all know, the generic List<T> class in .NET doesn't
// have a RemoveMultiple method. Could you implement it for me?
// Say the elements are kept in the _items field, which is an
// array of type T. Also, use _count to keep the current number
// of elements.
// PS: You can compare two items with "==" operator.
namespace System.Collections.Generic
{
public class List<T>
{
private T[] _items;
private int _count;
public void RemoveMultiple(IEnumerable<T> itemsToRemove)
{
// Please implement the method here.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment