My Blog List

[Leetcode Solution] Merge Sorted Array

Analysis

  • In-place algorithm
  • Each time compare one element in A and one in B. Put the bigger one into the target array
  • In order to avoiding disturb data in A as well as store result in A, combine in descending order and store from the tail of A

Note

Code


No comments:

Post a Comment

Enter you comment