Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string Mostrar()
- {
- string salida = "";
- if (!(EstaVacio()))
- {
- string contenido = "Contenido: { ";
- string posicion = "Posición: [ ";
- string indice = "Indice: [ ";
- for (int i = 0; i < arreglo.Length; i++)
- {
- contenido += arreglo[i];
- posicion += new string(' ', arreglo[i].ToString().Length - i.ToString().Length) + i;
- //Indice
- if (i == top)
- indice += new string(' ', arreglo[i].ToString().Length - 1) + "T";
- else
- {
- if (i < this.top)
- indice += new string(' ', arreglo[i].ToString().Length - 1) + "C";
- else
- indice += new string(' ', arreglo[i].ToString().Length);
- }
- //Comas
- if (i != arreglo.Length - 1)
- {
- contenido += ", ";
- posicion += ", ";
- indice += " ";
- }
- }//Fin For
- contenido += " }";
- posicion += ", " + this.max + "]";
- if (top == max)
- {
- indice += " T]";
- }
- else
- indice += " ]";
- salida = contenido + "\n" + posicion + "\n" + indice + "\n";
- salida += "C: Indica las celdas con contenido; T indica la posición de TOP\n";
- return salida;
- }
- else
- salida = "Arreglo Vacío";
- return salida;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement