one approch is very simple.

1. keep two index on arrays, lets say array1 and array2, which ever index
has small element put this element to   output array and move index of
smaller element to next position.

repeate above process untill one of the array index get exausted then append
remaining array to output.

corner cases when  one array is 1,2,3,4 and other is 5,6,7,8,...in this case
you just need to append them...take care of this...



On Wed, Jan 12, 2011 at 2:53 PM, Arindam Chatterjee <
arindam.chatterje...@gmail.com> wrote:

> Can anyone help:
>
> *In how many ways can 2 sorted arrays of combined size N be merged?*
>
> --
>
> Thanks and regards,
> ARINDAM CHATTERJEE,
> Mtech Second Year,
> Department of Computer Science and Engineering,
> IIT Bombay,
> Powai,
> Mumbai-400076
> Contacts : +919022313724
>
> Living is about making tomorrow better than today !!
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
--
Manoj Lalavat

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to