create AVL tree using elements of array 1... with each node of AVL tree
maintain a count variable...
if an element occurs more than once,increment the count... (this step is
not compulsory though,we can simply insert the new element in tree)
go through the second array,for each element in array, find the element in
AVL tree (if not found then arrays are not same)
delete the corresponding node (or decrement the count if maintianing
it)...finally the AVL tree should not have any element left..

O(nlogn)

-- 
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?hl=en.

Reply via email to