- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
本人答案整理自/~sahni/fdsc2ed/没有进行校对,仅为方便自己断网或网络不好时使用.如有纰漏,望请见谅.因见多有人寻此资源不果,遂分享之,以报多年来众驴友分享于我之万一.本答案为英文版数据结构基础(C语言版)即FUNDAMENTALS OF DATA STRUCTURES IN C 部分习题答案.答案所有文字描述均为英文.且仅有大部分习题答案.少数习题答案网站没有给出,因而我也没有办法.本人排版水平不佳,全部复制粘贴网站内容,几乎未经过任何排版,大家就将就看下吧.CHAPTER1Chapter 1, Pages 16-17Problem 1.a This statement is a poorly phrased version of Fermats last theorem. We know that we can find n 2 for which ?the equation holds. Fermat scribbled a note on a text margin indicating that he had found the solution for n = 2. Unfortunately, the proof died with him. Because the statement is phrased as a question? rather than a clearly defined algorithm, it lacks definiteness.Problem 1.b This statement violates not only the rules of mathematics, but the criterion of effectiveness. We can compute only those things that are feasible, and division by zero is mathematically undefinedPage 17, Exercise 3#include stdio.h#include math.h#include string.h#define TRUE 1#define FALSE 0#define MAX_STRING 100void truth_table(int);int main(){ int n; printf(n:(=0): ); scanf(%d, n); while (n = 0) { /*error loop */ printf(n:(=0): ); scanf(%d, n); } truth_table(n);}void truth_table(int n){/* generate a truth_table by transforming # of permutations into binary */int i,j, div, rem;char string[MAX_STRING];for (i=0; i pow(2,n); i++){/*number of permutations or rows in the table */ strcpy(string ,\0); div = i; for (j = n; j 0; j--) {/*number of bits needed for each row*/ rem = div%2; div = div/2; if (!rem) strcat(string,FALSE ); else strcat(string, TRUE ); } printf(%s\n, string); }}Page 17, Exercise 4#include stdio.hint min(int, int);#define TRUE 1#define FALSE 0int main(){ int x,y,z; printf(x: ); scanf(%d, x); printf(y: ); scanf (%d, y); printf(z: ); scanf(%d, z); if (min(x,y) min(y,z)) {/*x is smallest */ printf(%d , x); if (min(y,z)) printf (%d %d\n, y,z); else printf(%d%d\n, z, y);} else if (min(y,x) min(y,z)){ /*y is the smallest */ printf(%d , y);
您可能关注的文档
最近下载
- 高压电工培训第五章高压电气设备.ppt VIP
- 《新媒体写作》—教学教案.pdf VIP
- 2025年江苏省保安员考试试题带解析附参考答案【完整版】.docx VIP
- 中国大唐集团公司集控值班员考核试题库《电气运行》.pdf VIP
- 2019.01.25 方法精讲-判断之图形推理2 聂佳 (讲义+笔记).docx VIP
- 建筑工程图集 16G101-2:混凝土结构施工图平面整体表示方法制图规则和构造详图(现浇混凝土板式楼梯).pdf VIP
- 无人机结构与系统-第1章 无人机结构与飞行原理.pptx VIP
- 课件:协助老年人穿脱简易矫形器.pptx VIP
- 培训课件之螺钉的标准规范.ppt VIP
- 数字经济课程大纲.docx VIP
文档评论(0)