Subscribed unsubscribe Subscribe Subscribe

Takefumi Yamamura's blog

This blog is for my memorandum.

Takefumi Yamamura's b!og

This blog is for my memorandum

SortedMerge

ソート 就活

problem

You are given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B. Write a method B into A in sorted order.

how to solve

In this problem, I can use array A which has a large enough buffer at the end to hold B. So I insert elements into the back of the array in greedy.

code

Remove all ads