I'm looking for a way to create a method which should compare for example 2 strings with 1 comparable string and return 1, 0 or -1 (if the value is greater than, equal to, or less than). The method should look like this:
int CompareEnumerables<T>(IEnumerable<T> xs, IEnumerable<T> ys, IComparer<T> comp)
This is the condition: write method (method of general comparison of 2 random sequences (the objects of which are of the same type allowing comparison))
int CompareEnumerables<T>(IEnumerable<T> xs, IEnumerable<T> ys, iComparer<T> comp)
to return -1, 0 or 1 depending on which a series of lexicographical precedes the other.
Any idea how to do so? I tried a few times. If needed I will share code.