C
Daria·Saira
这个作者很懒,什么都没留下…
展开
-
Prog/Algo_practice_190401
Program/Algorithm_practice 1利用 二分法/dynamic array 实现子列最大和问题//FUNC1//output is only three states : left(A);mid(B);right(C)int max3(int A, int B, int C){ return A>B?A>C?A:C:B>C?B:C;}//find...原创 2019-04-03 17:13:52 · 129 阅读 · 0 评论 -
struct_Tree(2)_20190522
Tree (2)BST(binary search tree)ADTFindfind max/min nodeinsertdelete原创 2019-05-22 21:42:39 · 239 阅读 · 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 评论 -
C_Euclidean algorithm
最简分式(10分)题目内容:分数可以表示为“分子/分母”的形式。编写一个程序,要求用户输入一个分数,然后将其约分为最简分式。最简分式是指分子和分母不具有可以约分的成分了。如6/12可以被约分为1/2。当分子大于分母时,不需要表达为整数又分数的形式,即11/8还是11/8;而当分子分母相等时,仍然表达为1/1的分数形式。输入格式:输入在一行中给出一个分数,分子和分母中间以斜杠“/”分隔,如:...原创 2019-05-22 15:50:34 · 115 阅读 · 0 评论 -
C_test8_190511
C_test8_190511question 1题目内容:你的程序要读入一行文本,其中以空格分隔为若干个单词,以‘.’结束。你要输出这行文本中每个单词的长度。这里的单词与语言无关,可以包括各种符号,比如“it’s”算一个单词,长度为4。注意,行中可能出现连续的空格。输入格式:输入在一行中给出一行文本,以‘.’结束,结尾的句号不能计算在最后一个单词的长度内。输出格式:在一行中输出这...原创 2019-05-12 14:06:52 · 88 阅读 · 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 评论 -
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 评论 -
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 评论 -
C_test7.1(array/pointer)_190505
error analyse & reflect:1.情况分析不周全2.学习参考程序中对"输出(待解决问题)"最小分解后处理,防止对情况不周全考虑题目内容:一个多项式可以表达为x的各次幂与系数乘积的和,比如:2x6+3x5+12x3+6x+20现在,你的程序要读入两个多项式,然后输出这两个多项式的和,也就是把对应的幂上的系数相加然后输出。程序要处理的幂最大为100。输入格式:...原创 2019-05-05 21:34:31 · 104 阅读 · 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 评论 -
190419_c_test6
/* 题目内容:由于计算机内部表达方式的限制,浮点运算都有精度问题,为了得到高精度的计算结果,就需要自己设计实现方法。(0,1)之间的任何浮点数都可以表达为两个正整数的商,为了表达这样两个数的商,可以将相除的结果以多个整数来表示,每个整数表示结果的一位。即商的第一位用一个整数来表示,第二位用另一个整数来表示,以此类推,就可以输出一个高精度的除法结果了。如16/19的结果0.8421052...原创 2019-04-19 13:13:23 · 160 阅读 · 0 评论 -
C_190418_array
C_190418_arrayerror : variably modified at file scopehelp text 1help text 21、#define LISTEN_NUM 10 /*The MAX Number Of Users*/2、const int LISTEN_NUM = 10;/*UserProfile Struct, to store us...原创 2019-04-18 18:16:23 · 204 阅读 · 0 评论 -
C_190412_test5
#include<stdio.h>#include<math.h>//program_1/*我们认为2是第一个素数,3是第二个素数,5是第三个素数,依次类推。现在,给定两个整数n和m,0<n<=m<=200,你的程序要计算第n个素数到第m个素数之间所有的素数的和,包括第n个素数和第m个素数。*/// 2 3 5 7 9//input 2...原创 2019-04-12 15:17:31 · 134 阅读 · 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_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_Application example -- Graph
Application example – GraphQuestion 1.descriptionanalysis什么是图的顶点?鳄鱼头,湖岸,孤岛均为题意中抽象的节点图的边表示什么关系?可以从一个顶点跳到另一个顶点solutionthinking: Choose which method to represent the graph?此例中邻接矩阵/邻接表实现...原创 2019-06-18 19:55:08 · 194 阅读 · 0 评论