Struct
Daria·Saira
这个作者很懒,什么都没留下…
展开
-
Struct_chapter_2_线性结构_190407
struct_chapter_2_线性结构2.1 线性表及其实现2.1.1 引 : 多项式表示questionmethod_1顺序存储结构method_2顺序存储结构表示非零项非零项的两个信息(系数,指数)加法运算过程method_3链表结构存储非零项系数,指数,指针域2.1.2 线性表和顺序存储线性表 详见PPT...原创 2019-04-07 18:30:13 · 159 阅读 · 0 评论 -
Struct_Practice_TREE
Practice_TREEQuestion1post : 342651analysis:不知道node的具体顺序但结合 pre & in 可知左子树结点个数(green)及右子树结点个数(蓝)分而治之:实际后序操作:(current :1)树根至于最后对左子树(蓝)递归对右子树(绿)递归//已上图为例,当递归进行到对右子树的右子树调用时,//会出现n==0的...原创 2019-06-19 21:34:03 · 117 阅读 · 0 评论 -
Struct_shortest path algorithm_0620
Shortest path algorithmconcept无权图的单源最短路径算法Single source shortest path algorithm of unweighted graphinitialization : dist[w] 两种作用异常值(+/-∞/-1) : unvisited有效值 : s 到 w 的shortest distance...原创 2019-06-20 18:09:52 · 182 阅读 · 0 评论 -
Struct_Flody_190625
Flodyemmmmmm orz令人头秃,单独拿出来研究一下Q-1AQ当前已经求得最短路径的节点?当前选中D点则不会再有dist[d]被更新(dist[d]=10为a->d最短路径)若存在,由于安照递增次序,该点会在round4被选中而非d点在round4被选中, 反证法可严谨证明...原创 2019-06-25 21:38:57 · 91 阅读 · 0 评论 -
Struct_graph&practice_190705
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Ma...原创 2019-07-05 21:55:42 · 175 阅读 · 0 评论 -
Struct_graph&MST_190706
Struct_graph&MSTMSTAttribute of MSTMSTSolutionGreedy algorithmPrime<=nlognPrim算法中的dist[V]应该初始化为E(s,V)(weight–存在临接关系) 或 正无穷(无临接边)认为每一个点均为一颗树(森林),通过收容weight最小边将多棵树(森林)连接...原创 2019-07-06 17:47:54 · 130 阅读 · 0 评论 -
Struct-topological sorting
topological sorting相互依赖的关系原创 2019-09-20 22:18:28 · 242 阅读 · 0 评论 -
sort algorithm(1)
sort algorithmbackground info简单排序bubble_sort1.相邻选大顺序向下推,一趟完成后当前无序的全部data均被比较过,其中max沉底2.中途有序闭眼愣做swap傻乎乎,当一趟sort中没有一次swap发生—>整个数据范围内有序3.time complexity O(N2)通常对排序算法不可接受4.对array和chain t...原创 2019-09-22 15:54:10 · 74 阅读 · 0 评论 -
sort algorithm(2)
sort algorithm(2)merge_sort千好万好对空间不友好,不仅额外需要辅助数组空间(tmp),还在tmpA与tmp之间倒来倒去 ; 实际情况不用于内排序,外排序(空间非主要矛盾时)应用效果好1.merger sort click for power!指针不一定为指针变量,只要起到指示位置(下标)作用即可在归并排序开始声明临时数组并传入,整个归并排序过程中...原创 2019-09-22 18:21:46 · 152 阅读 · 0 评论 -
sort algorithm(3)
sort algorithm(3)quick sortconcept1.分治思想影响时间复杂度因素选取主元划分子集/* 快速排序 - 直接调用库函数 */ #include <stdlib.h> /*---------------简单整数排序--------------------*/int compare(const void *...原创 2019-09-24 03:03:13 · 115 阅读 · 0 评论 -
sort algorithm(4)
sort algorithm(4)table sort1.background info待排序item为较大结构体(书/视频),移动元素的时间及空间不可忽视2.表排序实质不移动item本身,仅移动其指针3.对其指针(逻辑意义指针,不一定指针变量)调用其它排序4.针对必须进行item间物理排序的情况每访问一个空位i后,就令table[i]=i(标明此位置已经有序,第二次访问即...原创 2019-09-24 17:45:55 · 105 阅读 · 0 评论 -
hash search
background inforequirement1.编译处理中对变量管理:实际是动态查找问题2.是否可以把字符串转化为数字处理? 2.例二 半序 : 某些item中存在某种顺序eg 查找树,节点比其左子树大,但小于其右子树,但并非(二分查找)完全有序(全序)(1)设计一个函数–>将对象映射成为较小数(即对象存储的位置)(2)解决冲突ADT...原创 2019-09-25 02:17:58 · 384 阅读 · 0 评论 -
string
StringconceptADTstorage顺序串堆串串匹配朴素匹配KMPconcept1.关键在于不回溯—>string上的指针不匹配时不会大幅度回溯2.先进行模式分析3.i 严格小于j----->自己跟自己的匹配无意义(永远一致),使用真子串比较4.match(x) : 满足条件最大值,找完...原创 2019-09-29 15:17:33 · 125 阅读 · 0 评论 -
Struct_Set & The operation of set
Set & The operation of setSetconcept双亲表示法 : 孩子指向双亲ADTsearchmerger原创 2019-06-03 21:36:49 · 105 阅读 · 0 评论 -
Struct_Application example -- Graph
Application example – GraphQuestion 1.descriptionanalysis什么是图的顶点?鳄鱼头,湖岸,孤岛均为题意中抽象的节点图的边表示什么关系?可以从一个顶点跳到另一个顶点solutionthinking: Choose which method to represent the graph?此例中邻接矩阵/邻接表实现...原创 2019-06-18 19:55:08 · 194 阅读 · 0 评论 -
Program/Algorithm_practice 1.2
Program/Algorithm_practice 1.2利用 online/dynamic array 解决子列最大和问题key pointscan the array by ordernowsum saves the current answermaxsum always saving the max valueand when nowsum is minus ,drop i...原创 2019-04-08 19:59:35 · 131 阅读 · 0 评论 -
Struct_chapter2.2_堆栈
Struct_chapter2.2_堆栈concept引例中缀 : a+bc前缀 : +abc(+) a+*bc --> a+b*c(*) b*c中缀 : a+ b*c - d/e后缀 : abc*+de/-(*) bc* --> b*c(+) abc*+ --> a+b*c(/) de/ --> d/e(-) abc*+de/- -->...原创 2019-04-20 12:33:23 · 214 阅读 · 0 评论 -
C_Polynomial multiplication and addition_190509
Polynomial multiplication and addition – realize by Cnotice : complement the codemathematical modeldata structstruct polynode{ int coef;//系数 int expon;//指数 struct polynode *link;//point to ...原创 2019-05-09 21:02:23 · 205 阅读 · 0 评论 -
struct_chapter2.3_queue_190508
struct_chapter2.3_queue2.3.1 sequential queueconceptqueue入队:addQ出队:deleteQfeatures先来先服务先进先出(FIFO)ADTrealization of sequential queuespecial statusCircular queuekey point :...原创 2019-05-09 22:46:02 · 241 阅读 · 0 评论 -
Struct_chapter3_Tree
Struct_chapter3_Tree3.1 tree and the expression of treeconcept of treean excellent struct to expresses hierarchical relationship(层次关系)more efficienctSearching0x01 static searchingnotice :...原创 2019-05-14 21:43:26 · 386 阅读 · 0 评论 -
02
#include<stdio.h>#include<stdlib.h>typedef struct{ int maxsum; int first; int end;}form;form online(int list[],int n){ form out; int nowsum=0; int i=0; int maxsum=-1; //two f...原创 2019-05-26 17:40:33 · 90 阅读 · 0 评论 -
struct_Tree(2)_20190522
Tree (2)BST(binary search tree)ADTFindfind max/min nodeinsertdelete原创 2019-05-22 21:42:39 · 239 阅读 · 0 评论 -
struct_heap
struct_heapneed to review1. heap_conception时间复杂度: T(N) = O( log N )typedef struct HNode *Heap; /* 堆的类型定义 */struct HNode { ElementType *Data; /* 存储元素的数组 */ int Size; /* ...原创 2019-05-30 16:31:45 · 265 阅读 · 0 评论 -
Struct_Graph
Struct_Graphwhat’s graphlinear list : one-to-onetree : one-to-manygraph : many-to-manylinear list and tree could regard as a special case of graphbasic termsADTexpression of graphadjace...原创 2019-06-05 21:29:22 · 180 阅读 · 0 评论 -
Struct_Huffman tree & Huffman code
Huffman tree & Huffman codeproblem backgroundthe existed questionunder this backgroundif most people’s grades are over the 90,means they have to take a lot of judgement which might be abl...原创 2019-06-01 18:06:32 · 148 阅读 · 0 评论 -
struct_Tree(3)_20190529
struct_Tree(3)_practicequestion : how to distinguish if it’s the same binary search treesolutionmethod 3 : build a search treenotice : flag=1 --> just reading the remaining numbers...原创 2019-05-29 21:26:49 · 193 阅读 · 0 评论 -
array
conceptn维数组顺序表示特殊矩阵的压缩存储三对角矩阵的原创 2019-09-30 18:00:50 · 89 阅读 · 0 评论