L7,
from the first array make a hash table H-> O(n)

go through the second array and test if the element is present in H1
->O(n)

so the solution is 2*O(n)=O(n)

Your solution:
sort the first array -> O(n log n)

sort the second array -> O( n log n)

compare the two arrays -> O(n)

the solution : 2*O(n log n) + O(n) = O( n log n)


Siva how will you use the B-tree, so you can make one node to
correspond to one block in the disk but how will you contro the writing
the each node to the disk. This is a issue of low level programing for
me. Siva please explain?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to