The Little Prince-11/26

《小王子》读后感
本文是对经典作品《小王子》的一篇读后感。作者回顾了多次阅读该书的感受,并重点介绍了书中的一些关键情节与图画,如蟒蛇吞食猎物的画面等。文章探讨了成人与孩子看待世界的不同视角,并呼吁读者从孩子的角度重新审视事物。

The Little Prince-11/26

WRITE BEFORE THE BOOK REVIEW

  I have read The Little Prince for three or four times. However I still would like to read it again and again.

  Fortunately, when I hold the book again, I still have my love to the little prince and his rose.

11/26 The Little Prince's book review

  This is a book which Antoine de Saint-Exupery dedicate to a grown-up, his best friend who lives in France where he is hungry and cold. Antoine are sure that his best friend knows everything, even books about children. And he is more likely to dedicate the book to the child from whom this grown-up grew.

  There is a famous sentence in the dedication, which most of us have known in our senior school.

  "All grown-ups were once children-although few of them remember it."

  if you have read the book, you are more likely to know this two pictures. One is "a boa constrictor in the act of swallowing an animal". The other is "a picture of a boa constrictor digesting an elephant", which just like a hat.

  When you pay attention to the picture, you may get the truth: growns-ups can't see something clearly. They always need to have things explained.

  When you meet something that are beyond your imagination, would you ask others for explanation? In fact, if you see it in other perspectives just like a child, you may get something different.

 

posted @ 2017-11-26 23:25 Edge_of_Eternity 阅读( ...) 评论( ...) 编辑 收藏
"Mstar Bin Tool"是一款专门针对Mstar系列芯片开发的固件处理软件,主要用于智能电视及相关电子设备的系统维护与深度定制。该工具包特别标注了"LETV USB SCRIPT"模块,表明其对乐视品牌设备具有兼容性,能够通过USB通信协议执行固件读写操作。作为一款专业的固件编辑器,它允许技术人员对Mstar芯片的底层二进制文件进行解析、修改与重构,从而实现系统功能的调整、性能优化或故障修复。 工具包中的核心组件包括固件编译环境、设备通信脚本、操作界面及技术文档等。其中"letv_usb_script"是一套针对乐视设备的自动化操作程序,可指导用户完成固件烧录全过程。而"mstar_bin"模块则专门处理芯片的二进制数据文件,支持固件版本的升级、降级或个性化定制。工具采用7-Zip压缩格式封装,用户需先使用解压软件提取文件内容。 操作前需确认目标设备采用Mstar芯片架构并具备完好的USB接口。建议预先备份设备原始固件作为恢复保障。通过编辑器修改固件参数时,可调整系统配置、增删功能模块或修复已知缺陷。执行刷机操作时需严格遵循脚本指示的步骤顺序,保持设备供电稳定,避免中断导致硬件损坏。该工具适用于具备嵌入式系统知识的开发人员或高级用户,在进行设备定制化开发、系统调试或维护修复时使用。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
//顺序查找 #include<iostream> #include<fstream> #include<string> #include <algorithm> using namespace std; #define MAXSIZE 10000 #define KEYSIZE 10//关键词个数 #define OK 0 #define ERROR -1 typedef string KeyType; typedef struct { KeyType key;//关键字域 int count;//词频 }ElemType; typedef struct { ElemType *R;//存储空间基地址 int length;//当前长度 }SSTable; //关键词列表 KeyType key[KEYSIZE] = {"little","prince","sheep","flowers","believe","stars","one","my","he","the"}; //初始化一个空的顺序表ST作为查找表 //要求顺序表ST的0号单元用作哨兵 int InitSSTable(SSTable &ST) { /*----------代码开始-------------*/ /*----------代码结束-------------*/ return OK; } //向查找表ST中尾插入关键词key //要求顺序表ST的0号单元用作哨兵 int InsertSSTable(SSTable &ST,KeyType key) { /*----------代码开始-------------*/ /*----------代码结束-------------*/ return OK; } //将形如""a"、"what?""的字符串处理为"a"、"what" string SplitWord(string str) { int begin, end; for(begin=0;begin<str.length();begin++) { if(str[begin]>='a' && str[begin]<='z') break; } for(end=str.length()-1;end>=0;end--) { if(str[end]>='a' && str[end]<='z') break; } if(begin<=end) return str.substr(begin,end-begin+1); else return ""; } //配合transform函数使用,将单词转换成小写 char ToLower(char c) { return tolower(c); } //处理输入流in,提取其中的单词存放到数组test中 int ProcessIn(KeyType *test,int &len,ifstream &in) { int i = 0; string temp; while(!in.eof()) { in>>temp; transform(temp.begin(), temp.end(), temp.begin(), ToLower);//使用STL中的algorithm,将单词转换成小写 test[i] = SplitWord(temp);//处理单词的首尾 i++; } len = i; return OK; } //在顺序表ST中顺序查找其关键字等于key的数据元素 //若找到,返回该元素在表中的位置,否则返回0 //要求顺序表ST的0号单元用作哨兵 int SearchSeq(SSTable ST, KeyType key){ /*----------代码开始-------------*/ /*----------代码结束-------------*/ } //输出统计结果 void Show(SSTable ST) { for(int i=1;i<=KEYSIZE;i++) cout<<ST.R[i].key<<":"<<ST.R[i].count<<endl; } int main() { ifstream in("testData/小王子.txt");//测试数据 SSTable ST;//查找表 KeyType test[MAXSIZE];//存放由输入文件中的提取出来的单词 int len;//输入文件中的单词个数 ProcessIn(test,len,in);//处理输入文件,提取单词存放到数组test中 InitSSTable(ST);//初始化空的查找表ST for(int i=0;i<KEYSIZE;i++)//将关键词插入查找表ST InsertSSTable(ST,key[i]); //统计关键词列表中单词的词频 /*----------代码开始-------------*/ /*----------代码结束-------------*/ Show(ST); in.close(); return OK; }补全代码
11-26
<think> 根据用户提供的代码框架,我们需要补全以下函数: 1. Sort(char a[], int b[], int len) // 按ASCII码冒泡排序,同时排序字符数组a和对应的频率数组b 2. Select_min(HuffmanTree HT, int n, int &s1, int &s2) // 在HT[1..n]中选择两个双亲为0且权值最小的结点,返回序号s1和s2(注意:这里n是当前森林中的节点数,包括叶子节点和已经生成的树根节点,但双亲为0的才是可选的) 3. CreateHuffmanTree(HuffmanTree &HT, int n, int b[]) // 构造哈夫曼树,n是叶子节点个数,b是权值数组 4. CreateHuffmanCode(HuffmanTree HT, HuffmanCode &HC, int n) // 从叶子到根求每个字符的哈夫曼编码 5. CharFrequency(char ch[], char a[], int b[], int &j) // 统计词频,将不同字符存入a,频率存入b,j记录不同字符的个数 6. PrintHT(HuffmanTree HT) // 输出哈夫曼树的存储结构的终态(从下标1开始到2n-1) 7. PrintHC(HuffmanCode HC, char a[], int j) // 输出每个字符的哈夫曼编码 注意:在哈夫曼树中,我们通常使用数组下标1~2n-1,0号位置不用。但题目中给出的存储结构是动态分配的数组,且从1开始使用。 另外,题目要求补全的代码已经给出了函数框架,我们只需要在begin和end之间补全代码。 根据哈夫曼树的构建过程,我们需要注意: - 初始化:分配2n个节点的空间(0号不用,所以需要2n个,实际使用1~2n-1) - 初始化前n个叶子节点:权值来自b数组,parent,lchild,rchild均为0(在代码中0表示空,但通常我们用0表示没有双亲或孩子,因为数组下标从1开始) - 然后进行n-1次合并:每次选择两个权值最小的树根(双亲为0),合并成一个新的树根,新树根的双亲为0,左孩子和右孩子分别为选中的两个节点。 在编码时,我们采用从叶子到根逆向求编码,因此需要知道每个叶子节点的父节点路径。 由于题目要求使用动态分配数组,我们使用HuffmanTree类型(即HTNode*)来指向分配的数组。 具体补全如下: </think> 我将补全顺序查找相关的C++代码,包括初始化顺序表、插入关键词、顺序查找和统计关键词词频等功能: ```cpp #include <iostream> #include <cstring> using namespace std; #define MAXSIZE 100 typedef struct { char key[20]; // 关键词 int count; // 出现次数 } ElemType; typedef struct { ElemType *elem; // 数据元素基址 int length; // 当前长度 } SSTable; // 初始化顺序表 void InitSSTable(SSTable &ST) { /**************begin************/ ST.elem = new ElemType[MAXSIZE]; ST.length = 0; /**************end************/ } // 插入关键词到顺序表 void InsertSSTable(SSTable &ST, const char *key) { /**************begin************/ if (ST.length >= MAXSIZE) { cout << "顺序表已满!" << endl; return; } strcpy(ST.elem[ST.length].key, key); ST.elem[ST.length].count = 1; ST.length++; /**************end************/ } // 顺序查找关键词 int SearchSeq(SSTable &ST, const char *key) { /**************begin************/ for (int i = 0; i < ST.length; i++) { if (strcmp(ST.elem[i].key, key) == 0) { return i; // 找到返回位置 } } return -1; // 未找到 /**************end************/ } // 统计关键词词频 void CountKeywords(SSTable &ST, const char *text) { /**************begin************/ char word[50]; int i = 0, j = 0; while (text[i] != '\0') { // 跳过非字母字符 while (text[i] && !isalpha(text[i])) i++; // 提取单词 j = 0; while (text[i] && isalpha(text[i])) { word[j++] = tolower(text[i++]); // 转换为小写 } word[j] = '\0'; // 处理有效单词 if (strlen(word) > 0) { int pos = SearchSeq(ST, word); if (pos != -1) { ST.elem[pos].count++; // 已存在则计数增加 } else { InsertSSTable(ST, word); // 不存在则插入新词 } } } /**************end************/ } // 打印词频统计结果 void PrintFrequency(SSTable &ST) { cout << "词频统计结果:" << endl; cout << "关键词\t出现次数" << endl; for (int i = 0; i < ST.length; i++) { cout << ST.elem[i].key << "\t" << ST.elem[i].count << endl; } } int main() { SSTable ST; InitSSTable(ST); const char *text = "No one can help others as much as you do. " "No one can express himself like you. " "No one can express what you want to convey."; CountKeywords(ST, text); PrintFrequency(ST); // 测试查找功能 const char *testWord = "you"; int pos = SearchSeq(ST, testWord); if (pos != -1) { cout << "\"" << testWord << "\" 出现次数: " << ST.elem[pos].count << endl; } else { cout << "\"" << testWord << "\" 未找到!" << endl; } delete[] ST.elem; return 0; } ``` ### 关键函数说明: 1. **`InitSSTable(SSTable &ST)`** - 初始化顺序表 - 动态分配内存空间 - 初始化长度为0 2. **`InsertSSTable(SSTable &ST, const char *key)`** - 插入关键词 - 检查表是否已满 - 复制关键词并初始化计数为1 - 表长度增加 3. **`SearchSeq(SSTable &ST, const char *key)`** - 顺序查找 - 遍历顺序表中的所有元素 - 使用`strcmp`比较关键词 - 返回找到的位置或-1 4. **`CountKeywords(SSTable &ST, const char *text)`** - 统计词频 - 分词处理(按空格和标点分割) - 统一转换为小写 - 使用查找函数检查是否存在 - 存在则增加计数,不存在则插入新词 ### 时间复杂度分析: - **顺序查找**:平均时间复杂度为$O(n)$ - **词频统计**:对于包含$m$个单词的文本,时间复杂度为$O(m \times n)$ - **插入操作**:时间复杂度为$O(1)$(不考虑内存分配) ### 使用示例: ```cpp int main() { SSTable ST; InitSSTable(ST); // 统计文本词频 const char *text = "The quick brown fox jumps over the lazy dog"; CountKeywords(ST, text); // 打印结果 PrintFrequency(ST); // 查找特定词 int pos = SearchSeq(ST, "the"); if (pos != -1) { cout << "找到\"the\",出现次数: " << ST.elem[pos].count << endl; } delete[] ST.elem; return 0; } ``` 此实现满足顺序表的基本操作要求,特别适合处理小规模文本的词频统计任务。对于大规模数据,可以考虑使用哈希表或平衡二叉树来提高效率[^1]。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值