whut数据结构复习题.doc

上传人:s****u 文档编号:12766994 上传时间:2020-05-23 格式:DOC 页数:10 大小:112KB
返回 下载 相关 举报
whut数据结构复习题.doc_第1页
第1页 / 共10页
whut数据结构复习题.doc_第2页
第2页 / 共10页
whut数据结构复习题.doc_第3页
第3页 / 共10页
点击查看更多>>
资源描述
Delegates, staff: Hello! in the run-up to the Spring Festival, we held one session of four staff representatives Conference 2013-workshop, full back in 2012, careful analysis of the current situation, discuss 2013 development plans. Here, on behalf of my company 2013 work reports to the General Assembly, for consideration. Pillar I, 2012 back in 2012, XX power companies adhere to the partys 17 great spirit for guidance, comprehensively implement the scientific concept of development, promoting cost-leadership strategy, standards, focus on implementation, lean management, continuously improve, smooth present safety situation of enterprise management, business management and control scientific and standardized, and the dedication of staff, manage a harmonious and democratic atmosphere of the good situation. Main indicators are as follows:-the battery indicator: power generation totaled 7.815 billion kWh, beyond the annual budget implementation capacity of 315 million kWh, an increase of 757 million kWh. Sales totaled 7.425 billion kWh, exceeding sales of 330 million kWh the annual Executive budget, an increase of 729 million kWh. -Security measures: unplanned outages 2.5 times. No personal injury accident occurred, no major accident and above, no major fire accidents without environmental pollution accidents, safety for three consecutive years to maintain stability to good posture. Business financial indicators: total profits of 255 million Yuan, beyond the annual budget of 207 million Yuan, beyond the Datang company index 41.89 million Yuan, an increase of 1.76 million Yuan, FCM assessment at grade four. -Energy: power supply standard coal completing 312.25 g/kWh, down 0.1 g/kWh; integrated auxiliary power consumption ratio in 5.12%, down 0.26%; pollutant emissions performance greatly reduced compared to last year, carbon 0.09 g/kWh, sulfur dioxide 0.104 g/kWh NOx 0.512 g/kWh; dust removal efficiency of more than 99.8%. -Reliability index: equivalent availability factor in 93.47%, increased 7.95% from a year earlier. Equivalent forced outage rate 0.08%, 0.16% reduction over the same period a year earlier. Major achievements: first, we should adhere to the two management system basis, strengthening technological research, strengthen hidden hazards control and intrinsic safety Enterprise construction took new steps. -The two management system for improvement. Focus on promoting the power of the company management system and the application and implementation of the safety loop five-star management system, improve the safety management system, realize the system of safety control. Further regulate security routines, safety supervision and management network role to play to achieve closed-loop. Strengthening the supervision and management of habitual violation of, strengthening the safety supervision of outsourcing contractors. Carried out in spring and autumn of security inspections, flood control and inspection, safety production month, day supervision of production safety and the Olympic Games and other复习题集一判断题()1 线性表在物理存储空间中也一定是连续的。()2 顺序存储方式只能用于存储线性结构。()3 栈是一种对所有插入、删除操作限于在表的一端进行的线性表,是一种后进先出型结构。()4 两个栈共享一片连续内存空间时,为提高内存利用率,减少溢出机会,应把两个栈的栈底分别设在这片内存空间的两端。()5 二叉树的度为2。()6 若二叉树用二叉链表作存贮结构,则在n个结点的二叉树链表中只有n1个非空指针域。()7 二叉树中每个结点的两棵子树的高度差等于1。 ()8 用二叉链表法存储包含n个结点的二叉树,结点的2n个指针区域中有n+1个为空指针。( )9 在冒泡法排序中,关键值较小的元素总是向前移动,关键值较大的元素总是向后移动。( )10计算机处理的对象可以分为数据和非数据两大类。( )11数据的逻辑结构与各数据元素在计算机中如何存储有关。()12算法必须用程序语言来书写。()13判断某个算法是否容易阅读是算法分析的任务之一。( )14顺序表是一种有序的线性表。( )15分配给顺序表的内存单元地址必须是连续的。()16栈和队列具有相同的逻辑特性。( )18树形结构中每个结点至多有一个前驱。( )19在树形结构中,处于同一层上的各结点之间都存在兄弟关系。( )20如果表示图的邻接矩阵是对称矩阵,则该图一定是无向图。( )21如果表示图的邻接矩阵是对称矩阵,则该图一定是有向图。( )22顺序查找方法只能在顺序存储结构上进行。( )23折半查找可以在有序的双向链表上进行。( )24满二叉树中不存在度为1的结点。( )25完全二叉树中的每个结点或者没有孩子或者有两个孩子。( )26对n个元素知心快速排序,在进行第一次分组时,排序码的比较次数总是n-1次。( )27在有向图中,各顶点的入度之和等于各顶点的出度之和。一、选择题( )1. 在n个结点的顺序表中,算法的时间复杂度是O(1)的操作是:A) 访问第i个结点(1in)和求第i个结点的直接前驱(2in) C) 删除第i个结点(1in)B) 在第i个结点后插入一个新结点(1in) D) 将n个结点从小到大排序(C)2. 算法分析的目的是:A) 找出数据结构的合理性 B) 研究算法中的输入和输出的关系C) 分析算法的效率以求改进 D) 分析算法的易懂性和文档性(A)3. 算法分析的两个主要方面是:A) 空间复杂性和时间复杂性 B) 正确性和简明性C) 可读性和文档性 D) 数据复杂性和程序复杂性(B)4. 计算机算法必须具备输入、输出和 等5个特性。A) 可行性、可移植性和可扩充性 B) 可行性、确定性和有穷性C) 确定性、有穷性和稳定性 D) 易读性、稳定性和安全性(B)5.一个向量第一个元素的存储地址是100,每个元素的长度为2,则第5个元素的地址是 (A)110 (B)108 (C)100 (D)120(A)5. 链接存储的存储结构所占存储空间:(A)分两部分,一部分存放结点值,另一部分存放表示结点间关系的指针(B)只有一部分,存放结点值(C) 只有一部分,存储表示结点间关系的指针(D) 分两部分,一部分存放结点值,另一部分存放结点所占单元数( )6. 一个栈的输入序列为1,2,3,n,若输出序列的第一个元素是n,输出第i(1in)个元素是。A) 不确定 B) ni1 C) i D) ni( )7. 最大容量为n的循环队列,队尾指针是rear,队头是front,则队空的条件是 ( )。 A) (rear1)% n=front B) rear=front C) rear1=front D) (rearl) % n=front( )8. 循环队列A0.m1存放其元素值,用front和rear分别表示队头和队尾,则当前队列中的元素数是 。A) (rearfrontm)%m B) rearfront1 C) rearfront1 D) rearfront( )9. 按照二叉树的定义,具有3个结点的二叉树有( )种。A) 3 B) 4 C) 5 D) 6( )10. 具有n(n0)个结点的完全二叉树的深度为 。() log2(n) () log2(n) () log2(n) +1 () log2(n)+1( )11在高度为h的完全二叉树中,表述正确的是( )A.度为0的结点都在第h层上 B.第i(1ih)层上的结点都是度为2的结点C.第i(1ih)层上有2i-1个结点 D.不存在度为1的结点( )12. 深度为5的二叉树至多有( )个结点。A) 32 B) 31 C) 16 D) 10( )13. 用邻接表表示图进行深度优先遍历时,通常采用( )结构来时实现算法。A) 栈 B) 队列 C) 树 D) 图( )14. 对N个记录作顺序查找时,当查找成功时,平均查找长度是( )。 A) N2 B) N2/2 C) N D)(N1)/2( )15. 当一个有n个顶点的图用邻接矩阵A表示时,顶点Vi的度是( )。( )16某算法的时间复杂度为O(2n),表明该算法的( )A.问题规模是2n B.执行时间等于2n C.执行时间近似与2n成正比 D.问题的规模近似与2n成正比( )17“二叉树为空”意味着二叉树( )A.由一些没有赋值的空结点构成 B.根结点没有子树 C.不存在 D.没有结点( )18数据结构的研究内容不涉及( )A.数据如何组织 B.数据如何存储 C.数据的运算如何实现 D.算法用什么语言描述( )19在存储数据时,通常不仅要存储各数据元素的值,而且还要存储A.数据的处理方法 B.数据元素的类型 C.数据元素之间的关系 D.数据的存储方法( )20数据采用顺序存储,要求( )A.存储的是属于线性结构的数据 B.根据结点值的大小,有序存放各结点C.按存储单元地址由低到高的顺序存放各结点 D.各结点存放方法有规律,能隐含表示结点间的逻辑关系( )21一个顺序表所占存储空间大的大小与( )无关A.顺序表长度 B.结点类型 C.结点中各字段的类型 D.结点存放顺序( )22数据采用链接存储,要求( )A.每个结点占用一片连续的存储区域 B.所有结点占用一片连续的存储区域C.结点的最后一个字段是指针型的字段 C.每个结点有多少个后继,就设多少个指针字段( )23算法的时间复杂度与( )有关A.问题规模 B.计算机硬件性能 C.编译程序质量 D.程序设计语言( )24在程序中,为了设置一个空的顺序表,必须( )A.给各数组元素赋空值 B.给各顺序表元素赋空值 C.给表示顺序表长度的变量赋初始值 D.给数组变量名赋初始值( )25若变量H是某个带表头结点循环单向链表的表头指针,则在该链表最后的一个结点的后继指针域中存放的是( )A.H的地址 B.H的值 C.表头结点的值 D.第一个结点的地址( )26栈和队列的共同点在于( )A.逻辑特性 B.存储结构 C.运算方法 D.元素类型( )27栈和队列的共同点在于( )A.都对存储方法作了限制 B.都是只能进行插入、删除运算C.都对插入、删除的位置作了限制 D.都对插入、删除两中操作的先后顺序作了限制( )28若5个元素的进栈序列是1,2,3,4,5,则不可能得到出栈序列( )A.1,2,3,4,5 B.3,4,2,5,1 C.4,2,1,3,5 D.5,4,3,2,1( )29顺序循环队列中是否可以插入下一个元素,( )A.与队首指针和队尾指针的值有关 B.只与队尾指针的值有关,与队首指针的值无关C.只与数组大小有关,与队首指针和队尾指针的值无关 D.与曾经进行过多少次插入操作有关( )30在顺序队列中,元素的排列顺序( )A.由元素插入队列的先后顺序决定 B.与元素值的大小有关C.与队首指针和队尾指针的取值有关 D.与数组大小有关( )31在高度为h的完全二叉树中,( )A.度为0的结点都在第h层上 B.第i(1ih)层上的结点都是度为2的结点C.第i(1inext ; (2) P-next = P; (3) P-next = P-next-next(4) P-next = P-next-next; (5) while(P!=NULL) P = P-next ;(6) while(Q-next != NULL) P = Q; Q=Q-next;(7) while(P-next != Q) P = P-next;(8) while(P-next-next != Q) P = P-next;(9) while(P-next-next != NULL) P = P-next;(10) Q = P; (11) Q = P-next; (12) P = L ; (13) L = L-next; (14) free(Q);3. 栈是一种特殊的线性表,允许插入和删除运算的一端称为 。不允许插入和删除运算的一端称为 。4. 用S表示入栈操作,X表示出栈操作,若元素入栈的顺序为1234,为了得到1342出栈顺序,相应的S和X的操作串为 。5数据的逻辑结构可以分为 和 两大类。6数据的运算用 表示。7逻辑上相邻的结点在存储器中也相邻,这是 存储结构的特点。8在长度为n的顺序表上实现定位操作,其算法的时间复杂度为 。9为了实现随机访问,线性结构应该采用 存储。10在长度为n的顺序表中插入一个元素,最多要移动 个元素。11栈的存储结构主要有 和 两种。12在编写程序的时候,如果栈的最大长度难以预先估计,则最好使用 栈。13在树形结构中,如果某结点 ,则称该结点为根结点;如果某结点 ,则称该结点为叶子。14在树形结构中,每个结点最多只有一个前驱。15 由3个结点所构成的二叉树有 种形态。 16二叉树的前序遍历按如下三个步骤进行: ; ; 。17二叉树的中序遍历按如下三个步骤进行: ; ; 。18在n个顶点的无向图中,至少有 条边,至多有 条边。19在n个顶点的有向图中,至少有 条边,至多有 条边。20如果排序不改变关键字相同的记录之间的相对次序,则称该排序方法是稳定的。21如果排序改变了关键字相同的记录之间的相对次序,则称该排序方法是不稳定的。22在一个图中,所有顶点的度数之和是所有边数的 倍。23无向图中边的数目等于邻接矩阵中非零元素个数的 倍。24在有序表(2,4,6,8,10,12,14,16,18)上用折半查找法查找元素9,其中第二次被比较的元素是 。25在有序表(2,4,6,8,10,12,14,16,18)上用折半查找法查找元素9,其中第三次被比较的元素是 。三、简答题1. 写出下列程序段的输出结果(队列中的元素类型QElem Type为char)。void main( )Queue Q; Init Queue (Q);Char x=e; y=c;EnQueue (Q,h); EnQueue (Q,r); EnQueue (Q, y);DeQueue (Q,x); EnQueue (Q,x); DeQueue (Q,x); EnQueue (Q,a); while(!QueueEmpty(Q) DeQueue (Q,y); printf(y); ;Printf(x);2. 简述以下算法的功能(栈和队列的元素类型均为int)。void algo3(Queue &Q)Stack S; int d;InitStack(S);while(!QueueEmpty(Q) DeQueue (Q,d); Push(S,d);while(!StackEmpty(S) Pop(S,d); EnQueue (Q,d); 3. 描述以下三个概念的区别:头指针、头结点、首元结点(第一个元素结点)。在单链表中设置头结点的作用是什么?答:首元结点是指链表中存储线性表中第一个数据元素a1的结点。为了操作方便,通常在链表的首元结点之前附设一个结点,称为头结点,该结点的数据域中不存储线性表的数据元素,其作用是为了对链表进行操作时,可以对空表、非空表的情况以及对首元结点进行统一处理。头指针是指向链表中第一个结点(或为头结点或为首元结点)的指针。若链表中附设头结点,则不管线性表是否为空表,头指针均不为空。否则表示空表的链表的头指针为空。这三个概念对单链表、双向链表和循环链表均适用。是否设置头结点,是不同的存储结构表示同一逻辑结构的问题。 头结点headdatalink 头指针 首元结点简而言之,头指针是指向链表中第一个结点(或为头结点或为首元结点)的指针;头结点是在链表的首元结点之前附设的一个结点;数据域内只放空表标志和表长等信息(内放头指针?那还得另配一个头指针!)首元素结点是指链表中存储线性表中第一个数据元素a1的结点。4. 25738L对以下单链表执行下列语句,简述代码的功能,并画出单链表结果示意图。T = L;while(T-next != NULL) T-data = 2 * T-data; T = T-next;5. 请画出下图的邻接矩阵和邻接表6. 树和二叉树之间有什么样的区别与联系?7. 一棵二叉树中的结点的度或为0或为2,则二叉树的枝数为2(n0-1),其中n0是度为0的结点的个数。8. 一个深度为L的满K叉树有以下性质:第L层上的结点都是叶子结点,其余各层上每个结点都有K棵非空子树,如果按层次顺序从1开始对全部结点进行编号,求:(1)各层的结点的数目是多少?(2)编号为n的结点的双亲结点(若存在)的编号是多少?(3)编号为n的结点的第i 个孩子结点(若存在)的编号是多少?(4)编号为n的结点有右兄弟的条件是什么?如果有,其右兄弟的编号是多少?请给出计算和推导过程。9. 如果用一个循环数组q0.m-1表示队列时,该队列只有一个队列头指针front,不设队列尾指针rear,而改置计数器count用以记录队列中结点的个数。(1)编写实现队列的三个基本运算:判空、入队、出队(2)队列中能容纳元素的最多个数是多少?10. 已知一棵二叉树的前序遍历结果为ABCDEF,中序遍历结果为CBAEDF,画出此二叉树。并给出其后序遍历的结果。11. 设如下图所示的二叉树B的存储结构为二叉链表,root为根指针,结点结构为:(lchild,data,rchild)。其中lchild,rchild分别为指向左右孩子的指针,data为字符型,root为根指针,试回答下列问题:(1)对下列二叉树B,执行下列算法traversal(root),试指出其输出结果;(2)假定二叉树B共有n个结点,试分析算法traversal(root)的时间复杂度。二叉树BC的结点类型定义如下:struct nodechar data;struct node *lchild, rchild;C算法如下:void traversal(struct node *root)if (root) printf(“%c”, root-data); traversal(root-lchild); printf(“%c”, root-data);traversal(root-rchild);AB D C F G E12. 设要将序列Q, H, C, Y, P, A, M, S, R, D, F, X中的关键码按字母序的升序重新排列。简述快速排序的思路,并以第一个元素为轴中心,给出用快速排序对序列一趟扫描的结果。四、算法填空1假设线性表用不带头结点的单向链表表示,结点数据类型如下:struct node int s; node * next;下面的算法用于求线性表的长度。请在方框中填入适当的内容,将算法补充完整。int GetLinkLen(node *h) int s;s=0; s=s+1; ;return(s);2设有n个顺序表元素存放在数组v1vn中,数组v的最大下标为n0,元素类型为TElem. 下面的算法用于删除顺序表中第一个值为x的元素。请在方框中填入适当内容,将算法补充完整。void DeleValue (TElem x) int i, j; i=1; While( ) i=i+1; if(i=n) vj-1=vj; ;五、算法设计题1.从顺序表中删除值为x的元素。答:假定顺序表为a,有效元素个数为n,下标从0开始。int DeleteReapeatValue(datatype * a, int * pNum, datatype x) int i, k, n; n=*pNum; k=0; for(i=0;in;i+)If(ai=x) k+;Else ai-k=ai;*pNum=n-1;return k;2.将顺序存储结构线性表(v1, v2, , vn)改变成(vk+1,vk+2, vn,v1,v2, vk)。答:void ChangeSequence(datatype * v) datatype aSIZE; for(int i=1;in;i+) ai=vi; for(i=1;i=n;i+) v(k+i)%n=ai;3.将顺序存储的线性表(v1, v2, , vn)改变成(v1, v3, v5,)。答:void ChangeSequence(datatype * v) for(int i=3;i=n;i+=2) vi-i/2=vi4.从顺序表中删除重复的元素,并使剩余元素间的相对次序保持不变。答:int DeleteAllReapeatValue(datatype * a, int * pNum) int n=*pNum; int i , j ; for(i=0;in;i+) for(j=i+1; jn;j+) if(ai!= INFINITY & ai=aj) aj= INFINITY; return DeleteReapeatValue(a,pNum, INFINITY);5.从键盘输入一系列整数,建立一个长度为n的、不含重复元素的顺序表。答:int CreateSequence() int aSIZE; int i=0, j, k; while(in) scanf(“%d”, &k); for(j=0; ji) a+i=k;6.从键盘输入n个整数,建立带表头结点的单向链表。答:LinkList CreateList() int i=0 , j , k; LinkList head=(Node*)malloc(sizeof(Node); Node* r=head,*p=NULL; While(inext; while(p)if(p-data=k) break;p=p-next; if(p=NULL) s=(Node*)malloc(sizeof(Node); s-data=k; r-next=s; r=s i+; return head;7.设H是带表头结点的单向链表的表头指针,将链表中数值重复的结点删除。答:LinkList DleReapeatValue(LinkList H) Node *p=H-next,*q,*s; While(p) s= p; q=s-next; while(q) if(p-data=q-data)s-next=q-next;free(q);q=s-next; s=s-next; q=q-next; p=p-next; 8. 设有一带头结点的单链表,编程将链表颠倒过来。要求不用另外的数组或结点完成。统计出单链表HL中结点的值等于给定值X的结点数。 int CountX(LNode* HL,ElemType x)9. 编写递归算法,计算二叉树中叶子结点的数目。为确保工程节能保温,该工程窗选用了未增塑聚氯乙烯(PVC-U)塑料窗,有效的降低了通过窗造成能量损失,为了使能量损失达到最小,外门、窗框与墙体之间的缝隙采用硬泡聚氨酯发泡剂,聚氯乙烯泡沫塑料等软质材料堵封activities, comprehensive and tamping Safety Foundation . Troubleshooting, management mechanism, give full play to role of technical supervision and realization of troubleshooting, management, improved process management. This year completed the boiler lower header leakage, boiler pressure, a major risk management, completed 29 of great risks and 3 General problems of governance. Complete chemistry lab construction, thermal control, and complete the boiler scale integrated management, host shafting vibration of 10 scientific and technological projects, such as. Complete supercritical 630MW on-line simulation system development and application of circulating water MCC standby power transformation, the transformation of desulfurization waste water, the unit water supply system of comprehensive treatment and discharge valve modification of coal mill 5 key technological transformation projects, group health is improved. -Science and technology innovation is further increased. Strengthen the characteristics of supercritical unit major issues, gradually clearing the particularity of supercritical unit and regularity. Developed motor oil time management, switch action times, statistics, coal-aided measurement software, improves the production level of lean management. Increased investment in science and technology, reporting science and technology projects and 14 technical project total cost percentage of the total annual production output of 0.25%. Large-scale coal-fired power plant flue gas desulfurization, denitrification complete development and application of key technologies project, won the national science and technology progress second prize. 630MW supercritical units optimized control strategies and the 630MW development and application of on-line simulation system for supercritical units, supercritical 600MW units of turbine driven boiler feed pump set of comprehensive treatment of defects Datang technology respectively one or two and third. Meanwhile, information technology achievements, the company was named China power information technology benchmarking enterprises. -Repair and maintenance has improved further. Modify the inspection standards and standards on a regular basis, standardizing work procedures, checking and inspection project. Deepening the BFS+ system, and implements maintenance information shared. Reorganizing RB logic again, and ensure the success of the RB. Innovating the mechanism of maintenance management, implemented a project manager system. Successful completion of two autonomous maintenance, reliability improved steadily. Implementing two c-level maintenance, project themselves 48.7% and 42.3%, respectively. Accomplish two circulating pumps repair and overhaul of four Mills, maintenance teams to get exercise. Promote the work of energy saving and consumption reducing, complete the unit energy consumption diagnosis, plant water balance test, 10 energy-saving projects. Second, we should adhere to three on the economic benefits of improving, outreach9
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 图纸专区 > 考试试卷


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!