Container and algorithms
<p>I'm trying to learn Java at the moment and I'm trying to do it by implementing my own container classes. My question is:<br>
If I've implemented let's say three different container classes and I do want to have the ability to sort each of them in three different ways, so I have:  </p>

<pre><code>Container_one with sort_1, sort_2, sort_3  
Container_two with sort_1, sort_2, sort_3  
Container_three with sort_1, sort_2, sort_3  
</code></pre>

<p>where sort_1, sort_2 and sort_3 are identicall algorithms in every container (but they're different to each other), is there a way to implement them just once and then reuse them in other containers or do I have to implement them every time I'm implementing new container?<br>
Thanks. </p>
