Difference between LinkedHashmap and LinkedTreemap

This question already has an answer here:

  • Difference between HashMap, LinkedHashMap and TreeMap 16 answers

  • For the performance part:

    Hashmap and LinkedHashMap supports O(1) get/put operations complexity time. LinkedHashMap preserves the order of the inserted items.

    TreeMap supports O(log n) get/put operations complexity time. Since it has a mechanism to preserver natural order of the items using Comparable or Comparator .

    链接地址: http://www.djcxy.com/p/92176.html

    上一篇: HashMap可以始终保持相同的顺序?

    下一篇: LinkedHashmap和LinkedTreemap的区别