static void Main(string[] args) { List list = new List(); list.Add(1); list.Add(2); list.Add(3); IListIterator iterator = list.CreateIterator(); while (iterator.MoveNext()) { Console.WriteLine(iterator.Current); } ReverseList revList = new ReverseList(); revList.Add(1); revList.Add(2); revList.Add(3); IListIterator revIterator = revList.CreateIterator(); while (revIterator.MoveNext()) { Console.WriteLine(revIterator.Current); } Console.Read(); }
public static int ReversedListCapacity(int[] data) { ReverseList<int> testList = new ReverseList<int>(); foreach (var i in data) { testList.Add(i); } return testList.Capacity; }
public static void Main(string[] args) { var list = new ReverseList<int>(); list.Add(8); list.Add(4); list.Add(3); list.Add(2); list.Add(1); // Console.WriteLine(list[4]); list.Remove(4); foreach (var i in list) { Console.WriteLine(i); } }
public static int ReversedListCapacity(int[] data) { ReverseList <int> testList = new ReverseList <int>(); foreach (var i in data) { testList.Add(i); } return(testList.Capacity); }
static void Main(string[] args) { ReverseList<string> test = new ReverseList<string>(); test.Add("item"); test.Add("item2"); test.Add("item3"); test.Add("item4"); test.Add("item5"); test.Add("item6"); for (int i = 0; i < test.Count; i++) { Console.WriteLine(test[i]); } test.Remove(2); for (int i = 0; i < test.Count; i++) { Console.WriteLine(test[i]); } foreach (var item in test) { Console.WriteLine(item); } }
public static void ReversedListAdd(int[] data) { ReverseList<int> testList = new ReverseList<int>(); foreach (var i in data) { testList.Add(i); } Assert.AreEqual(data.Length, testList.Count); int count = testList.Count; for (int i = 0; i < count; i++) { Assert.AreEqual(data[count-1-i], testList[i]); } }
public static void ReversedListRemove(int[] data, int[] indexToRemove) { ReverseList <int> testList = new ReverseList <int>(); foreach (var i in data) { testList.Add(i); } foreach (var i in indexToRemove) { testList.Remove(i); } Assert.AreEqual(testList.Count, data.Length - indexToRemove.Length); }
public static void ReversedListAdd(int[] data) { ReverseList <int> testList = new ReverseList <int>(); foreach (var i in data) { testList.Add(i); } Assert.AreEqual(data.Length, testList.Count); int count = testList.Count; for (int i = 0; i < count; i++) { Assert.AreEqual(data[count - 1 - i], testList[i]); } }
static void Main(string[] args) { ReverseList<string> test = new ReverseList<string>(); test.Add("blabla"); test.Add("blabla2"); test.Add("blabla3"); test.Add("blabla4"); test.Add("blabla5"); test.Add("blabla6"); for (int i = 0; i < test.Count; i++) { Console.WriteLine(test[i]); } test.Remove(2); for (int i = 0; i < test.Count; i++) { Console.WriteLine(test[i]); } foreach (var VARIABLE in test) { Console.WriteLine(VARIABLE); } }
public static void ReversedListRemove(int[] data,int[] indexToRemove) { ReverseList<int> testList = new ReverseList<int>(); foreach (var i in data) { testList.Add(i); } foreach (var i in indexToRemove) { testList.Remove(i); } Assert.AreEqual(testList.Count, data.Length - indexToRemove.Length); }