protected TreeNode<K, D> iterativeSearch(TreeNode<K, D> root, K k) {
        TreeNode<K, D> pointer = root;
        int side = this.comparator.compare(k, pointer.getKey());
        while (side != 0) {
            if (side < 0) {
                pointer = pointer.getLeftChild();
            } else {
                pointer = pointer.getRightChild();
            }
            if (isNil(pointer)) break;
            side = this.comparator.compare(k, pointer.getKey());
        }
        return pointer;
    }