Java LinkedHashMap Example
LinkedHashMap keeps the order-intersection
LinkedHashMap use map and DoubleLinkedList to implement it.
    LinkedHashMap map = new LinkedHashMap();
    map.put(1, "dog"); 
    map.put(2, "cat"); 
    map.put(3, "cow"); 
    Set set = map.keySet();
    for(Integer k : set){
TreeMap in Java, $\log(n)$ contains, insert, implements in Red-Black tree
    class Student{
        String name;
        Integer age;
        public Student(String name, Integer age){
   = name;
            this.age = age;

    class CompareTree implements Comparator{
        public int compare(Student s1, Student s2){

    TreeMap map = new TreeMap<>(new CompareTree());
    map.put(new Student("David", 3), "good");
    map.put(new Student("Michael", 4), "bad");