Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

Guía de estudio para Estructuras de Datos

Enviado por   •  12 de Junio de 2018  •  4.257 Palabras (18 Páginas)  •  420 Visitas

Página 1 de 18

...

using System.Linq;

using System.Text;

using System.Windows.Forms;

[→Librerías↑]

namespace colasypilas

{

public partial class frmMenu : Form

{

public frmMenu()

{

InitializeComponent();

}

private void cmdpila_Click(object sender, EventArgs e)

{

frmpila pil = new frmpila();

pil.Show();

}

private void cmdcola_Click(object sender, EventArgs e)

{

frmcola col = new frmcola();

col.Show();

}

private void cmdsalir_Click(object sender, EventArgs e)

{

Close();

}

private void frmMenu_Load(object sender, EventArgs e)

{

}

}

}

SEGUNDA PARTE – DECLARACIÓN Y DISEÑO

[→Librerías↑]

namespace colasypilas

{

public partial class frmcola : Form

{

public static string[] Cola;

public static int Frente;

public static int Final;

public static int N;

public frmcola()

{

InitializeComponent();

Cola = new string[1000];

Frente = -1;

Final = -1;

}

private void frmcola_Load(object sender, EventArgs e)

{

}

private void cmdok_Click(object sender, EventArgs e)

{

N=Convert.ToInt32(txtnum.Text);

txtnum.Text = "";

}

private void CmdInsercion_Click(object sender, EventArgs e)

{

frminsertar insert = new frminsertar();

insert.Show();

}

private void CmdMostar_Click(object sender, EventArgs e)

{

frmmostrar mostr = new frmmostrar();

mostr.Show();

}

private void CmdEliminacion_Click(object sender, EventArgs e)

{

frmeliminar elimi= new frmeliminar();

elimi.Show();

}

private void cmdMenú_Click(object sender, EventArgs e)

{

Close();

}

}

}

TERCERA PARTE - ELIMINAR

[→Librerías↑]

namespace colasypilas

{

public partial class frmeliminar : Form

{

public frmeliminar()

{

InitializeComponent();

}

private void cmdeliminar_Click(object sender, EventArgs e)

{

if (frmcola.Frente == -1)

{

MessageBox.Show("Cola Vacía");

return;

}

string elemento = frmcola.Cola[frmcola.Frente];

if (frmcola.Frente == frmcola.Final)

{

frmcola.Frente = -1;

frmcola.Final = -1;

}

else if (frmcola.Frente == frmcola.N)

{

frmcola.Frente = 0;

}

else

{

frmcola.Frente = frmcola.Frente + 1;

}

listboxeliminar.Items.Add(elemento);

}

private void frmeliminar_Load(object sender, EventArgs e)

{

...

Descargar como  txt (31.2 Kb)   pdf (187.6 Kb)   docx (604.5 Kb)  
Leer 17 páginas más »
Disponible sólo en Essays.club