给出一个数列
a[1],a[2],a[3],...,a[2n]
其中a[i]可以是任意值,可以重复也可以不重复。
要求用const auxiliary memory和linear time,把数组变成
a[1],a[3],...,a[2n-1],a[2],a[4],...,a[2n]
我只是说O(nlogn) time + O(1) memory比较容易办到,没说这样解决了原问题。显然O(n)+O(1)并不是容易的事情。
给出一个数列
a[1],a[2],a[3],...,a[2n]
其中a[i]可以是任意值,可以重复也可以不重复。
要求用const auxiliary memory和linear time,把数组变成
a[1],a[3],...,a[2n-1],a[2],a[4],...,a[2n]
我只是说O(nlogn) time + O(1) memory比较容易办到,没说这样解决了原问题。显然O(n)+O(1)并不是容易的事情。
WENXUECITY.COM does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by other users.
Copyright ©1998-2025 wenxuecity.com All rights reserved. Privacy Statement & Terms of Use & User Privacy Protection Policy