This question evaluates a candidate's competency in in-place array manipulation and algorithmic complexity analysis, emphasizing maintenance of sorted order under constant-space constraints.

You are given two sorted integer arrays nums1 and nums2.
nums1
has length
m + n
. The first
m
elements contain the sorted data in non-decreasing order. The last
n
elements are placeholders (for example, zeros) and should be ignored.
nums2
has length
n
and contains
n
sorted elements in non-decreasing order.
Merge nums2 into nums1 so that nums1 becomes a single sorted array of length m + n, still in non-decreasing order.
You must perform the merge in-place in nums1, using only O(1) additional space.
Describe your algorithm in detail and analyze its time and space complexity. You do not need to provide actual code.