private void DifferenceScan(ListFast <T> listFastReference, out ListFast <T> listFastBaseDifference, out ListFast <T> listFastReferenceDifference) { listFastBaseDifference = new ListFast <T>() { Unique = true }; listFastReferenceDifference = new ListFast <T>() { Unique = true }; int count = this.Count; //Base to Reference for (int i = 0; i < count; i++) { T value = this._items[i]; if (!listFastReference.Contains(value)) { listFastBaseDifference.Add(value); } } //Reference to Base count = listFastReference.Count; for (int i = 0; i < count; i++) { T value = listFastReference._items[i]; if (!listFastReferenceDifference.Contains(value)) { listFastReferenceDifference.Add(value); } } }
private bool IsEqualScan(ListFast <T> list) { for (int i = 0; i < this.Count; i++) { if (!list.Contains(this[i])) { return(false); } } return(true); }
public ListFast <int> Intersection(ListFast <int> list1, ListFast <int> list2) { ListFast <int> list = new ListFast <int>(); for (int i = list1.Count; i >= 0; i--) { int value = list1[i]; if (list2.Contains(value)) { list.Add(value); } } return(list); }