数据结构与程序设计.ppt
《数据结构与程序设计.ppt》由会员分享,可在线阅读,更多相关《数据结构与程序设计.ppt(20页珍藏版)》请在三一办公上搜索。
1、9/11/2023,数据结构与程序设计 教师:鲍钰,1,数据结构与程序设计(29),教师:鲍钰,9/11/2023,数据结构与程序设计 教师:鲍钰,2,Chapter 11,MULTIWAY TREES,9/11/2023,数据结构与程序设计 教师:鲍钰,3,Tries:Lexicographic Search TreesP531,DEFINITION A trie of order m is either empty or consists of an ordered sequence of exactly m tries of order m.,9/11/2023,数据结构与程序设计 教师
2、:鲍钰,4,9/11/2023,数据结构与程序设计 教师:鲍钰,5,C+Trie Declarations,Every Record has a Key that is an alphanumeric string.Method char key_letter(int position)returns the character in the given position of the key or returns a NONE,if the key has length less than position.Auxiliary function int alphabetic_order(ch
3、ar symbol)returns the alphabetic position of the character symbol,or 27 for nonblank,nonalphabetic characters,or 0 for blank,NONE characters.,9/11/2023,数据结构与程序设计 教师:鲍钰,6,Trie-Key,#include String.h#include iostream.hconst int key_size=10;class Key char strkey_size;public:Key(char s);char*the_key()con
4、st;char key_letter(int position)const;,9/11/2023,数据结构与程序设计 教师:鲍钰,7,Trie-Key,#include Key.hKey:Key(char s)for(int i=0;i=strlen(s);i+)stri=si;char*Key:the_key()constreturn(char*)str;char Key:key_letter(int position)constif(positionstrlen(str)return strposition;else return 0;,9/11/2023,数据结构与程序设计 教师:鲍钰,
5、8,Trie-Record,#include Key.hclass Recordpublic:operator Key();/implicit conversion from Record to Key.Record(char s=);char*the_key()const;char key_letter(int position)const;private:char strkey_size;ostream,9/11/2023,数据结构与程序设计 教师:鲍钰,9,Trie-Record,#include Record.hRecord:Record(char s)for(int i=0;i=st
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据结构 程序设计

链接地址:https://www.31ppt.com/p-5986019.html