摘要: 01-复杂度3 二分查找(20 分)本题要求实现二分查找算法。函数接口定义:Position BinarySearch( List L, ElementType X );其中List结构定义如下:typedef int Position;typedef struct ... 阅读全文
posted @ 2018-05-01 13:28 focus5679 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 02-线性结构2 一元多项式的乘法与加法运算(20 分)设计函数分别求两个一元多项式的乘积与和。输入格式:输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:输出分... 阅读全文
posted @ 2018-05-01 13:28 focus5679 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 01-复杂度2 Maximum Subsequence Sum(25 分)Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined ... 阅读全文
posted @ 2018-05-01 13:26 focus5679 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 01-复杂度1 最大子列和问题(20 分)给定K个整数组成的序列{ N​1​​, N​2​​, ..., N​K​​ },“连续子列”被定义为{ N​i​​, N​i+1​​, ..., N​j​​ },其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的... 阅读全文
posted @ 2018-05-01 13:25 focus5679 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 利用clock函数测试函数(算法)解决问题用时#include #include#include#include#include#include#include#include #include clock_t start, stop;//clock_t是clock(... 阅读全文
posted @ 2018-04-28 12:48 focus5679 阅读(313) 评论(0) 推荐(0) 编辑
摘要: KMP算法的核心思想是避免匹配失败时重新从短串的第一个字符开始匹配,从而提高匹配效率。#include #include#include#include#include#include#include#include typedef long long ll;usin... 阅读全文
posted @ 2018-04-26 15:00 focus5679 阅读(178) 评论(1) 推荐(0) 编辑
摘要: F. Flower RoadOnce upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the prince would l... 阅读全文
posted @ 2018-04-23 20:48 focus5679 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Hopscotch POJ - 3050 The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes i... 阅读全文
posted @ 2018-04-20 18:45 focus5679 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Network Saboteur FZU - 1346 A university network is composed of N computers. System administrators gathered information on the traffic... 阅读全文
posted @ 2018-04-18 21:46 focus5679 阅读(97) 评论(0) 推荐(0) 编辑
摘要: A Knight's Journey POJ - 2488 Background The knight is getting bored of seeing the same black and white squares again and again and ha... 阅读全文
posted @ 2018-04-17 22:33 focus5679 阅读(81) 评论(0) 推荐(0) 编辑