Write a function
vector merge_sorted(vector a, vector b)
that merges two sorted vectors,producting a new sorted vector.Keep an index into each 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 eg,
if a is , 1 4 9 16
and b is: 4 7 9 9 11
then merge_sorted returns the vector:
1 4 4 7 9 9 9 11 16
2007-01-05
19:06:59
·
6 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design