码迷,mamicode.com
首页 > 其他好文 > 详细

SinglyLinkList 3 -- What are we going to do?

时间:2015-09-08 19:56:46      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

The previous examples are just let us get used to link list, but in practice we don‘t just use link list to input and show the data, in other word there are functions we can implement to link list and make it more powerful.

 

Here is an ADT definiton to link list:

ADT LinkList

Data 
        instances ordered finite collections of zero or more elements 

Operations
        Initial(*L):    Initialize to create an empty link list  L
        IsEmpty(L):    Return whether the list is empty
        Clear(*L):    Clear list L to make it empty
        GetElem(L, i, *e):    Get the ith element in list L, return it to e
        HasElem(L, e):    Return true if found e in list L, otherwise return false
        Insert(*L, i ,e):    Insert element e in the position i of list L
        Delete(*L, i, *e):    Delete the ith element e, and return e
        Length(L);    Return number of elements in list L
endADT

 

SinglyLinkList 3 -- What are we going to do?

标签:

原文地址:http://www.cnblogs.com/Aegis-Liang/p/4792575.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!