《数据结构课件、代码》第6章 查找表-19-1幻灯片资料.pptVIP

  • 5
  • 0
  • 约4.2千字
  • 约 19页
  • 2018-11-20 发布于天津
  • 举报

《数据结构课件、代码》第6章 查找表-19-1幻灯片资料.ppt

《数据结构课件、代码》第6章 查找表-19-1幻灯片资料.ppt

第6章 查找表 张成文 北京邮电大学计算机学院 数据结构---第6章 查找 * 6.2.1 顺序表的查找 静态查找表以顺序表表示 0 1 2 n ST.elem[0..n] a1 a2 an [算法描述] typedef struct { ElemType *elem; int length; }SSTable; key int Search_Seq1( SSTable ST, KeyType key) { i=1; while (i=ST.length ST.elem[i].key!=key) i++; if (i=ST.length) return i; else return 0; }//Search_Seq1 int Search_Seq2( SSTable ST, KeyType key) { ST.elem[0].key=key; for (i=ST.length; ST.elem[i].key!=key; i--); return i; }//Search_Seq2 数据结构---第6章 查

文档评论(0)

1亿VIP精品文档

相关文档