自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 数据结构基础 排序

1-19To sort N records by simple selection sort, the numbers of comparisons and record movements are O(N ^2) and O(N), respectively. TR1-20图的深度优先遍历非递归算法通常采用栈实现,广度优先遍历非递归算法通常采用队列实现。 T...

2022-01-13 03:51:01 984

原创 数据结构基础 图

1-12如果无向图G必须进行3次深度优先搜索才能访问其所有顶点,则G一定有3个连通分量。 T

2022-01-13 03:33:42 1496

原创 数据结构基础 散列查找

1-5If 7 elements have been stored in a hash table of size 13 at positions { 0, 1, 3, 4, 9, 10, 12 }, and the hash function is H(x)=x%13. Then an empty spot can’t be found when inserting the element 26 with quadratic probing. T2-3哈希表的平均查找长度是()的函数。 C

2022-01-13 02:59:15 702

原创 数据结构基础 堆排序

1-2树的后根序遍历序列等同于它所对应二叉树的中序遍历序列。 T1-8For binary heaps with N elements, the BuildHeap function (which adjust an array of elements into a heap in linear time) does at most N−log(N+1) comparisons between elements. F2-1将森林转换为对应的二叉树,若在二叉

2022-01-13 01:43:14 689

原创 数据结构基础 二叉树与二叉搜索树

1-3在任意一棵非空二叉排序树中,删除某结点后又将其插入,则所得二排序叉树与原二排序叉树相同 F可能删的不是叶节点1-11二叉搜索树T的最小元素有可能不位于树根的左子树。 T可能没有左子树,最小值就是根2-9The time complexity of traversing(遍历) a binary tree with N nodes and height H in levelorder (with the help of with an auxiliary queue)

2022-01-13 00:34:33 971

原创 数据结构基础 树

1-2具有10个叶结点的二叉树中,有9个度为2的结点。Tn0 = n2 + 12-1深度为6的二叉树最多有( )个结点。 BA.64B.63C.32D.31深度为k的二叉树有最大结点总数为:2 ^k-12-3在完全二叉树中,若一个结点度为1,则它没有( )。 BA.左子树B.右子树C.左子树和右子树D.右子树和兄弟结点完全二叉树叶节点左偏2-4已知一棵完全二叉树的第6层(设根为第1层)有8个叶子结点,则该完全二叉树的结点个数最多是( )。 C

2022-01-12 23:39:34 109

原创 数据结构基础 队列

1-1所谓“循环队列”是指用单向循环链表或者循环数组表示的队列。 F数组是错的1-2“Circular Queue” is defined to be a queue implemented by a circularly linked list or a circular array. F循环队列”定义为循环链表或循环数组实现的队列数组是错的1-3An algorithm to check for balancing symbols in an exp

2022-01-12 22:43:09 561

原创 数据结构基础 栈

1-4Non recursive(递归) programs are generally faster than equivalent recursive programs. However, recursive programs are in general much simpler and easier to understand. T2-2假定利用数组a[n]顺序存储一个栈,用top表示栈顶指针,用top==-1表示栈空,并已知栈未满,当元素x进栈时所执行的操作为( )。 CA.a[–

2022-01-12 19:44:54 3672

原创 数据结构基础 链表

1-1将N个数据按照从小到大顺序组织存放在一个单向链表中。如果采用二分查找,那么查找的平均时间复杂度是O(logN)。 F链表不能二分查找1-2In a singly linked list of N nodes, the time complexities for query(查询) and insertion(插入) are O(1) and O(N), respectively. F链表查询为O(n);1-8下列函数试图求链式存储的线性表的表长,是否正确?

2022-01-12 18:38:28 1061

原创 数据结构与算法 外部排序

1-1To merge 55 runs using 3 tapes for a 2-way merge, the original distribution (34, 21) is better than (30, 25). T1-2Replacement selection is a method for generating longer runs in external sorting. T1-3Polyphase merge is a method

2022-01-12 17:17:38 2336

原创 数据结构基础 线性表

1-1对于顺序存储的长度为N的线性表,访问结点和增加结点的时间复杂度分别对应为O(1)和O(N)。 T1-2For a sequentially stored linear list of length N, the time complexities for deleting the first element and inserting the last element are O(1) and O(N), respectively. F1-3(neuDS)顺序存储的线性表不支持

2022-01-12 17:15:08 1960

原创 数据结构基础 绪论&基本概念

1-1数据的逻辑结构是指数据的各数据项之间的逻辑关系。F数据的逻辑结构是指数据的各数据元素之间的逻辑关系2-4在 Data_Structure = (D,R)中,D 是( )的有限集合。 AA.数据元素B.算法C.数据操作D.数据对象2-15被计算机加工的数据元素不是孤立的,它们彼此之间一般存在某种关系,通常把数据元素之间的这种关系称为 BA.规则B.结构C.集合D.运算2-17计算机所处理的数据一般具有某种关

2022-01-12 16:54:44 509

原创 数据结构与算法 贪心法

1-2Let S be the set of activities in Activity Selection Problem. Then there must be some maximum-size subset of mutually compatible activities of S that includes the earliest finish activity a m T1-3令S为活动选择问题(Activity Selection Problem)中所有活

2022-01-12 01:43:33 761

原创 数据结构与算法 B-B+树-归并排序&基数排序

B-树中所有结点的最大度称为B-树的阶,通常用m表示,从查找效率考虑,要求m≥3。一棵m阶B-树或者是一棵空树,或者是满足下列要求的m叉树:① 树中每个结点至多有m棵子树。② 若根结点不是叶子结点,则至少有两棵子树。③ 除根结点外,所有内部结点至少有m/2棵子树。n为该结点中关键字个数,并且满足m/2-1≤n≤m-1内部结点关键字最多个数max=m-1内部结点关键字最少个数min= m/2-1一棵m阶B+树满足下列条件:① 每个分支结点至多有m棵子树。② 根结点或者没有子树,或者至少有两

2022-01-11 22:41:52 836

原创 数据结构与算法 查找

顺序查找时间复杂度: O(n)顺序查找缺点:效率低顺序查找优点:算法简单,对元素次序无要求。既适用于顺序表,又可用于单链表;折半查找的效率比顺序查找高。 O(log2n)折半查找只能适用于有序表,并且以顺序存储结构存储。1-3适于动态查找表进行高效率查找的组织结构是分块有序表 F2-5已知N元整型数组a存放N个学生的成绩,已按由大到小排序,以下算法是用对分(折半)查找方法统计成绩大于或等于X分的学生人数,请填空使之完善。#define N /学生人数/

2022-01-11 21:13:13 465

原创 数据结构与算法 拓扑排序&关键路径

拓扑排序是指有向无环图中各顶点构成的有序序列拓扑排序:从入度为0的结点开始,排一个删一个;1-1If graph G has a cycle, then G does not have a topological sorting sequence. T如果图 G 有环,则 G 不存在拓扑排序序列1-2If a connected graph G has no topological sorting sequence, then graph G must have a cycle.

2022-01-11 20:08:19 2015

原创 数据结构与算法 最短路径

迪杰斯特拉(Dijkstra)算法:稠密图的时间复杂度是O(|V|2),稀疏图可以改进为O(|E|log|V|)1-2P 是顶点 S 到 T 的最短路径,如果该图中的所有路径的权值都加 1,P 仍然是 S 到 T 的最短路径。 F走的边多,最短路径加的数大,可能导致最短路径不是最短。2-2若要求在找到从S到其他顶点最短路的同时,还给出不同的最短路的条数,我们可以将Dijkstra算法略作修改,增加一个count[]数组:count[V]记录S到顶点V的最短路径有多少条。则count[V]应该被初始

2022-01-11 17:12:22 681

原创 数据结构与算法 DFS-BFS遍历&MST

DFS(深度优先) 时间复杂性:采用邻接矩阵存储结构时,查找所有顶点的邻接点所需时间为O(|V|2);而采用邻接表时,找邻接点所需时间为O(|E|)。因此,DFS的时间复杂度为O(|V|+|E|) 。BFS和DFS一样;以邻接矩阵为存储结构的Prim算法中,时间复杂度为O(|V|2);邻接表作为存储结构,Prim时间复杂度改进为O(|E|log|V|)。Kruskal算法总体时间复杂度为O( |E|·log|V| )1-1Prim’s algorithm is to maintain a fo

2022-01-11 00:12:17 1039

原创 数据结构与算法 并查集

1-1In Union/Find algorithm, if Unions are done by size, the depth of any node must be no more than N/2, but not O(logN). FTime complexity of N Union and M Find operations is now O( N + M log2 N ).Let T be a tree created by union-by-siz

2022-01-10 23:26:27 2560

原创 数据结构与算法 Huffman

1-1Given a Huffman tree for N (≥2) characters, all with different weights. The weight of any non-leaf node must be no less than the weight of any node on the next lower level. T1-2Let C be an alphabet in which each character c in C has

2022-01-10 22:49:08 893

原创 数据结构与算法 AVL查找树

1-1The inorder traversal sequence of an AVL tree must be in sorted (non-decreasing) order. TAVL 树的中序遍历序列必须是有序(非递减)顺序1-3An AVL tree with the balance factors of all the non-leaf nodes being 0 must be a perfect binary tree.

2022-01-10 21:12:21 2730

原创 数据结构与算法 稀疏矩阵与广义表

2-4稀疏矩阵一般的压缩存储方法有____。两种。 CA.二维数组和三维数组B.三元组和散列C.三元组和十字链表D.散列和十字链表2-10(SWPU-DS)广义表 A=(a,b,(c,d),(e,(f,g))),则 Head( Tail( Head( Tail( Tail(A) ) ) ) ) 的值为( )。 DA.(g)B.(d)C.cD.d4第一个元素是head,后面所有加一个括号是tail;第一层得到:(

2022-01-10 19:13:25 208

原创 数据结构与算法 KMP算法

1-1假设模式串是abababaab,则KMP模式匹配算法中的next[j] = 0 1 1 2 3 4 5 6 2 T2-3(neuDS)设有两个串p和q,其中q是p的子串,求q在p中首次出现的位置的算法称为( )。CA.求子串B.联接C.模式匹配D.求串长2-4(neuDS)设主串的长度为n,模式串的长度为m,则串匹配的KMP算法时间复杂度是( )。CA.O(m)B.O(n)C.O(n + m)D.O(n×m)2-6

2022-01-10 18:33:48 600

原创 面向对象程序设计(Java) chapter11

1.The UML uses _______ before a member name to indicate that the member is protected.单选题 (1 分)BA.?B.#C.+D.-30.The UML uses _______ before a member name to indicate that the member is package-private.单选题 (1 分)AA.none (blank)B.+C.-D.#43.The UML

2022-01-09 20:24:09 1534

原创 面向对象程序设计(Java) chapter12

1.A Java exception is an instance of __________.单选题 (2 分)EA.ExceptionB.RuntimeExceptionC.ErrorD.NumberFormatExceptionE.Throwable3.Analyze the following code:class Test {public static void main(String[] args) {try { String s = "5.6"; Integ

2022-01-09 17:01:49 906

原创 面向对象程序设计(Java) chapter13

The java.lang.Number and its subclasses are introduced in Chapter 11. Analyze the following code.Number numberRef = new Integer(0);Double doubleRef = (Double)numberRef; 单选题 (2 分)CA.There is no such class named Integer. You should use the class In...

2022-01-09 13:05:29 1664

原创 面向对象程序设计(Java) chapter9

An immutable class cannot have _______.C单选题 (1 分) 1 分A.static data fieldsB.no-arg constructorsC.public data fieldsD.public constructorsE.private data fields2.A source code file may contain several classes.A判断题 (1 分) 1 分A.trueB.false...

2022-01-08 21:33:47 1386

原创 面向对象程序设计(Java) chapter10

The following program displays C__.public class Test {public static void main(String[] args) {String s = "Java";StringBuilder buffer = new StringBuilder(s);change(s);System.out.println(s);}private static void change(String s) {s = s + " and...

2021-12-05 01:43:44 843

原创 面向对象程序设计(Java)chapter01

cuoti

2021-12-05 00:40:29 789

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除