Fastest way to compare two data structures in java
<p>I would like to know what is the fastest way in java 1.5 to compare two data structures.</p>

<p>My data structure represents a tree that can be pretty big. I can traverse the whole data structure and compare the 2 node by node (which I guess will be slow). Or I can compute a hash of the data structure to do it faster, right ?</p>

<p>What is the best (efficient and not too long) way to compute this hash ? </p>

<p>I wouldn't like to need too much time to compute hash...</p>

<p>Hope I'm clear.. :-)...</p>
