[教学设计]数据结构算法经典 -单循环链表.docVIP

  • 15
  • 0
  • 约5.51万字
  • 约 8页
  • 2018-01-10 发布于湖北
  • 举报

[教学设计]数据结构算法经典 -单循环链表.doc

[教学设计]数据结构算法经典 -单循环链表

数据结构算法经典 -单循环链表 # define null 0 typedef char ElemType; typedef struct Circular { ElemType data; struct LNode *next; }; setnull(struct Circular **p) { *p=null; } int length (struct Circular **p) { int n=0; struct Circular *q=*p; while (q!=null) { n++; q=q-next; } return(n); } ElemType get(struct Circular **p,int i) { int j=1; struct Circular *q=*p; while (jiq!=null) { q=q-next; j++; } if(q!=null) return(q-data); else printf(position parameter is incorrect!\n); } int locate(struct Circular **p,ElemType x) { int n=0; struct Circular *q=*p; whi

文档评论(0)

1亿VIP精品文档

相关文档