This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please write an sequence list implements the interface with the required | |
// time complexity described in the comments. The users can add the same | |
// element as many times as they want, but it doesn't support the null item. | |
// You can use any types in .NET BCL but cannot use any 3rd party libraries. | |
// PS: You don't need to consider the multi-threaded environment. | |
interface IMyList<T> : IEnumerable<T> | |
{ | |
// O(1) | |
// Add an item at the beginning of the list. | |
void AddFirst(T item); |