阅读背景:

在少于O(n)的时间内反转数组的子数组

来源:互联网 

how can we reverse a subarray ( say from i-th index to j-th index ) of an array ( or any other data structure , like linked-list ( not doubly )), in less than O(n) time ? the O(n) time consumption is trivial.( I want to do this reversion many times on the array , like starting from the beginning and reversing it for n times (each time , going forward for one index and then reversing it again), so there should be a way ,which its amortized analysis would give us a time consumption less than O(n) , any idea ?how can we reverse a subarray ( say from i-th i




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: