zoukankan      html  css  js  c++  java
  • The List ADT

    1、Definiation

    A list is a sequence.  a0, a1,a2,..., aN (N>0)

    2、Character

    For any list except the empty list, we say that Ai follows(or succeeds)Ai-1(i<N) and that Ai-1 precedes Ai(i>0).

    3、Operations

    (1) LenList(L);            // 返回表的长度
    (2) GetElem(i, e);       // 换值
    (3) SearchElem(e, i); // 按值查找
    (4) InertElem(i, e); // 插值
    (5) DeleteElem(i);   // 删值
    

    (1)LenList(L);

    LenList(L)
       output: 整数类型;
       Post-condition: 输出表的长度;
    

    (2) GetElem(L, i);

    GetElem(i, e)
        Input: 位置参数;
        output: e;
        Pre-condition: 0<=i<LenList(L);
        Post-condition: e被赋予在list的第i个位置;
    

    (3) SearchElem(L, e)

    SearchElem(e, i)
         intput: e;
         output: 位置参数i;
         Pre-condition: i<LenList(L);
         Post-condition: if e 存在于表中,则输出位置参数,否则输出为0; 
    

    (4)InsertElem(i, e)

    InsertElem(i, e)
       input: 位置i, e;
       Pre-condition: 0<=i<LenList(L);
       Pos-condition: 在i 的位置插入e;
    

    (5)DeleteElem(i)

    DeleteElem(i)
        input: 位置参数i;
        Pre-condition: 0<=i<LenList(L);
        Pos-condition: 删除位置i上的元素;
  • 相关阅读:
    the Agiles Scrum Meeting 8
    the Agiles Scrum Meeting 7
    the Agiles Scrum Meeting 6
    项目使用说明——英文版
    第十次例会
    第九次例会
    第八次例会
    第六次例会
    第七次例会
    第五次例会
  • 原文地址:https://www.cnblogs.com/KennyRom/p/5879081.html
Copyright © 2011-2022 走看看