Exemplo n.º 1
0
        private void btnPreencher_Click(object sender, EventArgs e)
        {
            int tamanho = Convert.ToInt32(txtTamanho.Text);

            nums = new CArray(tamanho, dgvVetor, chkAnimar.Checked);
            for (int i = 0; i < tamanho; i++)
            {
                nums.Insert(i);
            }
        }
Exemplo n.º 2
0
        public CArray Copiar()
        {
            CArray copia = new CArray(numElements, dgv, animar);

            for (int indice = 0; indice < numElements; indice++)
            {
                copia.Insert(arr[indice]);
            }
            return(copia);
        }
Exemplo n.º 3
0
        private void btnAleatorio_Click(object sender, EventArgs e)
        {
            int tamanho = Convert.ToInt32(txtTamanho.Text);

            nums = new CArray(tamanho, dgvVetor, chkAnimar.Checked);
            Random rnd = new Random(tamanho);

            for (int i = 0; i < tamanho; i++)
            {
                nums.Insert(rnd.Next(tamanho));
            }
        }