0

What would be the time complexity associated with concatenating arrays? Not merging them as in merge sort, but simply concatenating them using System.arraycopy(). Thanks.

7
  • What do you think it would be? Why do you think so? Why do you have doubts? Commented Aug 25, 2014 at 21:22
  • 1
    Surely, it's just adding to the new array with all the entries of the other? Which would be O(n). Commented Aug 25, 2014 at 21:22
  • ^That's what I think, but I'm trying to ask for expertise from someone who might know more about the inner workings of the function. Commented Aug 25, 2014 at 21:23
  • read this question stackoverflow.com/questions/18638743/… Commented Aug 25, 2014 at 21:24
  • 1
    @StriplingWarrior - On second thoughts agreed. And besides that, after a little digging around the implementation of arraycopy() is platform dependent so there probably isn't a single canonical answer anyway. Commented Aug 25, 2014 at 21:34

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.