I have two already sorted List<int>
, how do I efficiently merge them into just one sorted list?
For example:
List<int> a = new List<int>() {1, 2, 3};
List<int> b = new List<int>() {1, 4, 5};
List<int> aAndB = ....?
I would like that my aAndB
list ot look like: {1, 1, 2, 3, 4, 5}