Tuesday, January 25, 2011

Array and indeces

You are given an array A[1..n] and array B[1...n], build an array C containing the position in B where a[i] occurs. Complexity?

1 comment:

  1. Can be done in O(n log n) easily, don't know anything better.

    ReplyDelete