合并排序数组而不在Java中使用排序功能 [英] Merging sorted arrays without using a sort function in Java
本文介绍了合并排序数组而不在Java中使用排序功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个分配问题需要解决,而无需使用排序命令。我将不胜感激任何建议。
I have an assignment question that I need to solve without using a 'sort' commmand. I would appreciate any advice.
问题:假设您有两个整数数组,arr1和arr2,每个数组都包含按升序排序的整数。
QUESTION: Suppose you have two arrays of ints, arr1 and arr2, each containing integers that are sorted in ascending order.
编写一个名为merge的静态方法,该方法为这两个数组接收一个参数,并返回对一个新的,经过排序的int数组的引用,这是合并arr的int结果和arr2。
Write a static method named merge that recieves these two arrays a parameters and returns a reference to a new, sorted array of ints that is the result of merging the ints of arr and arr2.
推荐答案
这篇关于合并排序数组而不在Java中使用排序功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文