public void dividir(Integer num) {
        int cont = 0;
        Nodo<T> q = p;
        while (q != null) {
            q = q.getLiga();
            cont++;
        }
        q = p;
        int primeraParte = cont - cont / 2;
        cont = 0;
        if (num == 1) {
            while (cont != primeraParte) {
                System.out.println(q.getValor());
                q = q.getLiga();
                cont++;
            }
        } else {
            while (cont != primeraParte) {
                q = q.getLiga();
                cont++;
            }
            while (q != null) {
                System.out.println(q.getValor());
                q = q.getLiga();
            }
        }
    }