merge two arraylist lists in list1 while it remain sorted

后端 未结 7 586
再見小時候
再見小時候 2021-01-16 10:43

In my assignment the third step is to Call the method merge to merge the two lists in list1 so that the list1 remains sorted.

I write my code but it

7条回答
  •  爱一瞬间的悲伤
    2021-01-16 11:43

    public list mergeAndSort(List list1, List list2){
    List list3;
    int list2Size = list2.size();
    for(int i=0;i list2(j)){
                small = list2(j;
            }
        }
        list3.add(small); //Smallest 1 will be added to the new list
    }
    

    }

提交回复
热议问题