正在加载图片...
《数据结构》实验指导/实验五:数组的存储及操作 5 操作步骤1一设置稀疏矩阵行数列数的信息 行数:6列数:7「设置稀碳矩阵行数 操作步骤2一元素赋值操作 赋值后的三元组表示如下: AL 2 2 0 元素赋值 3 d-123567 5 共有7个非零元素 操作步骤3-取元素值操作 x=A【5,5][取元素值 操作提示求得A[5,5]=7 (4)编写窗体中按钮等控件的代码,调用三元组顺序表类,参考如下 SMatrix Class tm=new SMatrixClassO private void button Click(object sender, EventArgs e) tm trip. rows=int Parse(text Boxl Text) trip private void button2 Click(object sender, EventArgs e) Int 1,1,X; j=Convert. Tolnt32(text Box4.Text) X=Convert. Tolnt32(text Box5. Text) 管理科学与工程学科/共7页第5页《数据结构》实验指导 / 实验五:数组的存储及操作 5 管理科学与工程学科 / 共7页,第5页 (4) 编写窗体中按钮等控件的代码,调用三元组顺序表类,参考如下: SMatrixClass tm = new SMatrixClass(); private void button1_Click(object sender, EventArgs e) { tm.trip.rows = int.Parse(textBox1.Text); tm.trip.cols = int.Parse(textBox2.Text); } private void button2_Click(object sender, EventArgs e) { int i, j, x; try { i = Convert.ToInt32(textBox3.Text); j = Convert.ToInt32(textBox4.Text); x = Convert.ToInt32(textBox5.Text); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有