Untitled

 avatar
unknown
plain_text
2 years ago
326 B
6
Indexable
@Override
public String toString() {
    StringBuilder sb = new StringBuilder();
    Nodo temp = cabeza;
    while (temp != null) {
        sb.append(temp.getDato());
        if (temp.getEnlace() != null) {
            sb.append("−>");
        }
        temp = temp.getEnlace();
    }
    return sb.toString();
}
Editor is loading...