merging is merging...you can use different methods to do this...

1. I have told you...

2. build BST and print inorder

3. find biggest element, create hash of that size, init table element to
zero (assume zero is not in input array)
 traverse each array and put that element into hash table

finally print hashtable for non-zero elements.

......I hope you get some idea...


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

> @Manoj: Thanks, but can u tell me the no. of ways in which merging can be
> done on 2 arrays.
>
>
> On Wed, Jan 12, 2011 at 3:06 PM, manoj lalavat <manoj.lala...@gmail.com>wrote:
>
>> 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<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
>
> 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