标题:C#数据结构链表排序,如何排序?
只看楼主
冷锋2048
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2015-10-27
结帖率:57.14%
 问题点数:0 回复次数:0 
C#数据结构链表排序,如何排序?
  //链表排序
        public void paixu(ref LinkedList a)//有参数链表a的,参数在main函数

        {
            Node tempNode = a.head;
            for (int i = 0; i < count; i++)
            {
                for (int j = 0; j < count; j++)
                {
                    if ((int)tempNode.item > (int)tempNode.next.item  )//这行报错
                    {
                        int b = 0, c = 0, d = 0;
                        c = (int)tempNode.next.item;
                        b = (int)tempNode.item;
                        d = c;
                        c = b;
                        b = d;
                    }
                    tempNode = tempNode.next;
                }
            }
        }
然后我就没头绪了....不知道在哪里修改
搜索更多相关主题的帖子: 如何 count public 
2016-05-17 12:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-464925-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.075435 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved