Code example for Random

Methods: nextDouble

0
size--;
    } 
 
    private int randomLevel() { 
        return Math.max(1, (int) ((MAX_LEVEL - 1) * random.nextDouble()));
    } 
 
    private Node search(final double element) {
        Node curr = head;
        for (int i = level - 1; i >= 0; i--) {
            while (curr.next[i] != head && curr.next[i].element < element) {
                curr = curr.next[i];
            } 
        } 
        curr = curr.next();
        if (curr != head && curr.element == element) {
            return curr;
        } 
        return null; 
    }