广东工业大学数据结构AnyView参考答案

觉得还行,请点赞关注,您的点赞,我的动力!

1、第一章

  1. #include "allinclude.h"  //DO NOT edit this line
    void Descend(int &a, int &b, int &c)  // 通过交换,令 a >= b >= c
    {   // Add your code hereif(a < b){swap(a, b);}if(a < c){swap(a,c);}if(b < c){swap(b,c);}
    }void swap(int a, int b){int c;c = a;a = b;b = a;
    }
    
  2. #include "allinclude.h"  //DO NOT edit this line
    float Polynomial(int n, int a[], float x0)
    {   // Add your code herefloat result=0;for(int i = 0; i <= n; i++){result += a[i]*pow((x0),i);}return result;
    }
    
  3. 。。。

  4. #include "allinclude.h"  //DO NOT edit this line
    Status Series(int a[], int n) { // Add your code hereif(n == 0){return ERROR;}int result=1, res = 1;for(int k = 1; k <= n; k++){res = 1;for(int j = 1; j <= k; j++){res = res * j;}res = res*pow(2,k);if(res > MAXINT){return EOVERFLOW;}a[k-1] = res;}return OK;}
    
  5. #include "allinclude.h"
    void printName(stuType student[], int index[], int n)
    { for(int i = 0; i < n; i++){printf("%s\n", student[index[i]].name);}
    }
    
  6. #include "allinclude.h"
    float highestScore(stuType *student[], int n)
    {  // Add your code herefloat max=0;for(int i = 0; i < n; i++){if(max < student[i]->score){max = student[i]->score;}}return max;
    }
    
  7. #include "allinclude.h"
    void printFirstName_HighestScore(stuType *student[], int n)
    {  // Add your code herestuType *studentMax=NULL;float scoreMax=0;for(int i = 0; i < n; i++){if(scoreMax < student[i]->score){studentMax = student[i];scoreMax = student[i]->score;}}for (int i = 0; i < 4; i++) {printf("%c", studentMax->name[i]);}printf("\n%.2f\n",  studentMax->score);
    }
    
  8. #include "allinclude.h"
    void printLastName_HighestScore(stuType *student[], int n)
    {  // Add your code herestuType *studentMax=NULL;float scoreMax=0;for(int i = 0; i < n; i++){if(scoreMax <= student[i]->score){studentMax = student[i];scoreMax = student[i]->score;}}for (int i = 0; i < 4; i++) {printf("%c", studentMax->name[i]);}printf("\n%.2f\n",  studentMax->score);
    }
    
  9. #include "allinclude.h"  //DO NOT edit this line
    void A() {printf("X\n");
    }
    void B() {printf("Y\n");
    }int main()
    {void (*funcp)(); //定义函数指针funcp = A;(*funcp)(); // 实际上调用了A( );funcp = B;(*funcp)(); // 实际上调用了B( );return 0;
    }
    
  10. #include "allinclude.h"  //DO NOT edit this line
    void hello()
    { printf("Hello world!\n");
    }void runFun(void (*pFun)())
    {pFun();  //函数指针;
    }int main()
    {runFun(hello);  //hello是实际要调用的函数return 0;
    }
    
  11. #include "allinclude.h"
    StrSequence* reverseStr(StrSequence* strSeq)
    /*返回一个结构体,该结构体将strSeq中的字符串逆序存放*/
    {  // Add your code hereint length    = strSeq->length;ElemType *str = (ElemType*)malloc(length);for(int i = length-1; i >= 0; i--){str[length-1-i] = strSeq->elem[i];}StrSequence *res = (StrSequence*)malloc(sizeof(StrSequence));res->elem   = str;res->length = length;return res;
    }
    
  12. #include "allinclude.h"  //DO NOT edit this line
    Status CreateSequence(Sequence &S, int n, ElemType *a) { if(n <= 0) return ERROR;S.length = n;S.elem = a;return OK;
    }
    
  13. #include "allinclude.h"  //DO NOT edit this line
    LinkList MakeNode(ElemType x) { // Add your code hereLNode *head=(LNode*)malloc(sizeof(LNode));head->data = x;head->next = NULL;return head;
    }
    
  14. #include "allinclude.h"  //DO NOT edit this line
    LinkList CreateLinkList(ElemType x, ElemType y) { // Add your code hereLNode *head,*p;head=(LNode*)malloc(sizeof(LNode));p=(LNode*)malloc(sizeof(LNode));if(head!=NULL){head->data=x;head->next=p;}if(p!=NULL){p->data=y;p->next=NULL;}return head; return NULL; // This is a temporary code. Change it if necessary.
    }
    
  15. #include "allinclude.h"  //DO NOT edit this line
    LinkList CreateOrdLList(ElemType x, ElemType y) { // Add your code hereLNode *head, *p;head = (LNode*)malloc(sizeof(LNode));p    = (LNode*)malloc(sizeof(LNode));head->next = p;p->next = NULL;if(x < y){head->data = x;p->data = y;} else {head->data = y;p->data = x;}return head;
    }
    

izeof(LNode));

      head->next = p;p->next = NULL;if(x < y){head->data = x;p->data = y;} else {head->data = y;p->data = x;}return head;}```

广东工业大学数据结构AnyView参考答案相关推荐

  1. C语言模拟电梯(广东工业大学数据结构课设)

    课 程 设 计 课程名称 数据结构 题目名称电梯模拟(难度1.4) 学生学院 专业班级 学    号 学生姓名 指导教师 2019 年 1 月 9日 需求分析 本程序是实现电梯的模拟运行,同时还包含模 ...

  2. 808《数据结构》参考答案

    " 关注hahaCoder 获取最新资讯" 2020编程题 1. 从键盘输入10个整数建立一个顺序表,编程求这10个整数的最大值和次大值并输出. 答:程序如下所示: 思路提示:将1 ...

  3. 南京晓庄学院大一第二学期计算机数据结构期末考试试卷及答案,南京晓庄学院数据结构题库参考答案.docx...

    文档介绍: 数据结构与算法****题册(课后部分参考答案)<数据结构与算法>课程组目录课后****题部分第一章绪论 1第二章线性表 3第三章栈和队列 5第四章串 8第五章数组和广义表 10 ...

  4. 中国矿业大学计算机控制技术英语,中国矿业大学计算机控制系统参考试卷4及答案.pdf...

    中国矿业大学计算机控制系统 参考试题Ⅳ及答案 一.填空(每题2 分,共16 分) 1.零阶保持器频率特性将会引起 -T/2 的相位延迟. 2.离散系统频率特性的主要特点是它的幅相特性是采样频率的周期 ...

  5. 南京晓庄学院大一第二学期计算机数据结构期末考试试卷及答案,南京晓庄学院数据结构题库参考答案...

    南京晓庄学院数据结构题库参考答案 (29页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 27.9 积分 .. .. ..数据结构与算法习题册(课后部分参 ...

  6. 青少年软件编程(202209)(C语言)(数据结构)等级考试(六级)试题及参考答案

    等级标准 掌握数据结构及结构的概念: 掌握数据结构中的指针和链表: 掌握数据结构中的栈: 掌握数据结构中的队列: 掌握数据结构中的哈希: 能够使用上述方法编写指定功能的正确完整的程序. stack o ...

  7. 《数据结构与算法》第二版-陈卫卫-陆军工程大学811数据结构教材 第1-2章 参考答案

    <数据结构与算法>(第二版)陈卫卫-高等教育出版社     陆军工程大学811数据结构教材    第1-2章 参考答案 习题1.1 1.1-1      (1)名称.数量.特征.性质的   ...

  8. 新农慕课python答案、第七周_优学院《作业治疗》完整答案中国大学慕课《农作学》课后作业参考答案...

    优学院<作业治疗>完整答案中国大学慕课<农作学>课后作业参考答案 更多相关问题 [判断题]由点及面法是一种将典故.故事.传说等与景物介绍有机结合起来的讲解方法( ). A. 对 ...

  9. php 科试题,科学网—《数据库系统原理与技术》试题库试题与参考答案选编6 - 程学先的博文...

    一.选择题 1等值连接与自然连接是(). A.相同的 B.不同的,自然连接是两表普通连接 C.不同的,自然连接连接条件无等值要求 D.不同的,自然连接连接条件有等值要求 D 2关系数据库管理系统应能实 ...

最新文章

  1. druid+spring配置
  2. 网络:TCP粘包问题?如何解决?
  3. boost::spirit模块实现一个类似于 XML 的小型解析器的测试程序
  4. addcslashes php,php addcslashes函数怎么用
  5. [vue] 怎么捕获组件vue的错误信息?
  6. linux shell 获取参数 $,Linux - Shell - 参数获取
  7. UI基础之UITableView案例QQ聊天界面
  8. java建立新文件保存数据_关于java中创建文件,并且写入内容
  9. day03-PyCharm的设置与使用
  10. 在python中对文件操作的一般步骤是_文件操作(一) 笔记------python
  11. window.opener 与 window.dialogArguments的用法
  12. 目前SolidWorks软件哪个版本比较好用?更稳定一些?
  13. 【Windows 问题系列第 5 篇】常见电脑蓝屏的解决办法
  14. 浅谈FLUKE光缆认证?何为CFP?何为OFP?
  15. 神经计算棒python_神经计算棒-Movidius™ Neural Compute SDK Python API
  16. 关于PC端清除企业微信占用C盘空间的方法
  17. CVTE软件C语言面试经验,CVTE软件技术支持面试总结
  18. 当他不再爱你的时候!
  19. unity3d实现像素游戏的精确碰撞判定
  20. 测试公开课资料系列02--Postman之chai.js断言应用

热门文章

  1. 基于html+js实现轮播图(自动轮播、左右按钮、小圆点点击及切换图片)
  2. 【记录】Ubuntu已连接网络但无法上网解决方法
  3. 微信搭建本地开发测试环境
  4. HTTP常用的响应码说明(网页/服务器显示200、302、404、500是什么意思,表示什么)
  5. 修改本地hosts文件,出现不能写只能读权限,近root账户,密码忘记怎么办?
  6. 【python】pygame实现植物大战僵尸小游戏(附源码 有注释)
  7. 为什么谷歌会从零开始构建一个全新的操作系统?
  8. MySQL主从状态检查
  9. Autoware介绍
  10. 报错:Error: module property was removed from Dependency