Write a functionvector<int> merge_sorted(vector<int> a, vector<int> b)that merges two

Chapter 6, Problem P6.28

(choose chapter or problem)

Write a functionvector merge_sorted(vector a, vector b)that merges two sorted vectors, producing a new sorted vector. Keep an index intoeach vector, indicating how much of it has been processed already. Each time,append the smallest unprocessed element from either vector, then advance the index.For example, if a is1 4 9 16and b is4 7 9 9 11then merge_sorted returns the vector1 4 4 7 9 9 9 11 16

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back