zoukankan      html  css  js  c++  java
  • 顺序表中多余元素的删除

    #include<stdio.h>
    #include<iostream.h>
    #define  MAX  1000
    typedef  int  DataType
    typedef  struct
    {
        DataType   data[MAX];
     int last;
    }SeqList;
    int Delete_SeqList(SeqList  * L)
    {
       int i,j,k;
       DataType  temp;
       for(i=1;i<=L->last;i++)
       {
           temp=L->last;
        for(j=2;j<=L->last;j++)
        {
          if(temp=L->last[j])
       {
            for(k=j;k<=l->last;k++)
               {
         L->last[k]=L->last[k+1];
             L->last--;
               }         
       }
        }
       }
    }
    void main()
    {
        int i;
     SeqList  s;
     s.last=0;
     for(i=1;i<=L->last,i++)
        {
       if(i==L->last)
       {
        s.data=i-1;
         printf("%d\n",s.data);
         s.data[++i]=i;
            s.last++;
       }
       else
        s.data=i;
           s.last++;
         printf("%d\n",s.data);
     }
        s.data[s.last]=L->last/2-1;
        s.last++;
     printf("%d\n",s.data[s.last-1]);
     Delete(&s);
     for(i=1;i<=L->last;i++)
      printf("%d",s.data);
       printf("\n");
    }

  • 相关阅读:
    生成PDF文档
    2016 百度研发岗面试总结
    有趣的数
    2016阿里校招python研发面试
    python 快排,堆排,归并
    三种简单的排序写下贴上
    BestCoder Round #47 1003
    c++ 适配器
    微信公众平台-超级大赛问题汇总1
    正则表达式简单总结
  • 原文地址:https://www.cnblogs.com/QQbai/p/2135260.html
Copyright © 2011-2022 走看看