careercup上一题求解..合并array# JobHunting - 待字闺中
s*d
1 楼
We have two sorted int arrays
a[] --> size N --> contains N elements
b[] --> size 2N --> contains N elements, and N vacant locations
Write an algorithm of complexity O(n) such that b[] contains elements of a[]
and b[] in ascending order.
merge()能保证复杂度o(n)吗?......sorting还没复习,稀里糊涂的现在==||
a[] --> size N --> contains N elements
b[] --> size 2N --> contains N elements, and N vacant locations
Write an algorithm of complexity O(n) such that b[] contains elements of a[]
and b[] in ascending order.
merge()能保证复杂度o(n)吗?......sorting还没复习,稀里糊涂的现在==||