Module Module1 Function doMerge(ByVal inListA As List(Of Integer), ByVal inListB As List(Of Integer)) As List(Of Integer) Dim outList As New List(Of Integer) Console.WriteLine(String.Format("ListA: {0} ListB: {1}", String.Join(", ", inListA), String.Join(", ", inListB))) If ((inListA.Count = 0) And (inListB.Count = 0)) Then Return outList End If If (inListA.Count = 0) Then Console.WriteLine(String.Format("ListB: {0}", String.Join(", ", inListB))) Return (inListB) End If If (inListB.Count = 0) Then Console.WriteLine(String.Format("ListA: {0}", String.Join(", ", inListA))) Return (inListA) End If If (inListA(0) < inListB(0)) Then Dim newList As New List(Of Integer) ' Add the first item to the list newList.Add(inListA(0)) ' GetRange arguments are beginning index and count of items ' AddRange adds multiple items to a list newList.AddRange(doMerge(inListA.GetRange(1, inListA.Count - 1), inListB)) Return newList End If If (inListB(0) < inListA(0)) Then Dim newList As New List(Of Integer) ' Add the first item to the list newList.Add(inListB(0)) ' GetRange arguments are beginning index and count of items ' AddRange adds multiple items to a list newList.AddRange(doMerge(inListB.GetRange(1, inListB.Count - 1), inListA)) Return newList End If End Function Sub Main() Dim eat As String Dim listA As New List(Of Integer) From {1, 3, 5, 7, 9, 11, 13, 15} Dim listB As New List(Of Integer) From {0, 2, 4, 6, 8, 10} Dim mergedList As List(Of Integer) ' will be set by return Console.WriteLine(String.Format("Original - ListA: {0} ListB: {1}", String.Join(", ", listA), String.Join(", ", listB))) mergedList = doMerge(listA, listB) Console.WriteLine(String.Format("Merged list: {0}", String.Join(", ", mergedList))) Console.WriteLine("Any key to continue") eat = Console.ReadLine() End Sub End Module