public void put(int key, int value) {
        Node n;
        int ex = get(key);

        if (ex == -1) {
            n = new Node(key);
            if (root == null && tail == null)
                root = tail = n;
            else
                tail.next = n;
            tail = n;
        } else {
            n = tail;
        }
        map.put(key, value);
        mm.put(key, n);
        if (map.size() > cap) {
            map.remove(root.val);
            mm.remove(root.val);
            root = root.next;
        }

    }
Why Did you create this class? what does it do?
src/codeforces/LRU.java