正在加载图片...
《数据结构》实验指导/实验二:单链表的存储及操作 6 LinkList Class L=new LinkListClasso ∥单链表L private void Forml Load(object sender, EventArgs e) textBoxl. Text=2, 3, 1, 5, 6, 2, 3. 8 private void button1 Click(object sender, EventArgs e) tring str= text BoxlText Trimo infolabel. Text="操作提示必须输入元素"; stringll split= str Split(new Charll',,,.,: '1) CreatelistR(split); button1. Enabled= false button2 Enabled= true; infolabel. Text="操作提示成功创建单链表 private void button2 Click(object sender, Eventargs e) int i elem text Box2. Text: i=L Findlast(L, elem); if(i==0) infolabel. text="操作提示在单链表中没有找到该元素; else text Box3Text=iToString(; 管理科学与工程学科/共7页第6页《数据结构》实验指导 / 实验二:单链表的存储及操作 6 管理科学与工程学科 / 共7页,第6页 LinkListClass L = new LinkListClass(); //单链表 L private void Form1_Load(object sender, EventArgs e) { textBox1.Text = "2,3,1,5,6,2,3,8"; } private void button1_Click(object sender, EventArgs e) { string str = textBox1.Text.Trim(); if (str == "") infolabel.Text = "操作提示:必须输入元素"; else { string[] split = str.Split(new Char[] { ' ', ',', '.', ':' }); L.CreateListR(split); button1.Enabled = false; button2.Enabled = true; infolabel.Text = "操作提示:成功创建单链表"; } } private void button2_Click(object sender, EventArgs e) { int i; string elem; elem = textBox2.Text; i = L.Findlast(L, elem); if (i == 0) infolabel.Text = "操作提示:在单链表中没有找到该元素"; else { textBox3.Text = i.ToString();
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有