Remember, the loop in question is for testing only. On Thu, Aug 7, 2008 at 11:37 PM, Shalin Shekhar Mangar < [EMAIL PROTECTED]> wrote:
> It maintains doubly linked list through the Map.Entry objects. Additional > memory will be used to keep two(?) additional references per entry. The > cost > in terms of asymptotic behavior is the same. However, iteration is faster > because it depends on the size whereas with HashMap, iteration is > proportional to it's capacity. > > In practice, it is almost as fast and should not be a problem. > > On Fri, Aug 8, 2008 at 11:56 AM, Ted Dunning <[EMAIL PROTECTED]> > wrote: > > > How much memory overhead does the linked hash map add? How much speed > > cost? > > > > That would solve the problem by making the order stable, but we shouldn't > > slow down the code just to make the test easier to write, especially when > > the additional code in the test is < 1 line of code. > > > > On Thu, Aug 7, 2008 at 11:12 PM, Shalin Shekhar Mangar < > > [EMAIL PROTECTED]> wrote: > > > > > Or use a LinkedHashMap? > > > > > > > > > > > > -- > Regards, > Shalin Shekhar Mangar. > -- ted
