![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM algorithm
文章平均质量分 77
cynorr_
这个作者很懒,什么都没留下…
展开
-
剔除多余括号(CTSC94-1) c++
键盘输入一个含有括号的四则运算表达式,可能含有多余的括号,编程整理该表达式,去掉所有多余的括号,原表达式中所有变量和运算符相对位置保持不变,并保持与原表达式等价。设待整理的表达式为(s1 op s2);op为括号内优先级最低的运算符(“+”,“-”或“*”,“/”);左邻括号的运算符为“/”,则括号必须保留,即…/(s1 op s2)…形式。左邻括号的预算符为“*”或“-”。而op为“+”或转载 2014-09-19 13:03:24 · 2015 阅读 · 1 评论 -
kmp 算法导读
【KMP算法简介】 KMP算法是一种改进后的字符串匹配算法,由D.E.Knuth与V.R.Pratt和J.H.Morris同时发现,因此人们称它为克努特——莫里斯——普拉特操作(简称KMP算法)。通过一个辅助函数实现跳过扫描不必要的目标串字符,以达到优化效果。 【传统字符串匹配算法的缺憾】 Bill认为,对于一种优化的算法,既转载 2014-09-08 16:47:57 · 341 阅读 · 0 评论 -
Theory: MST -- Kruskal
例题:HDU-1233原创 2014-09-21 16:46:20 · 393 阅读 · 0 评论 -
编程第一周小结
无论怎么原创 2014-09-21 13:51:32 · 593 阅读 · 0 评论 -
Theory:MST -- prim
a. MST: Provided undirected graph G = ( V , E ),to connect every point in V set, there is a set which is E's subset of edges. The total lengths of all edges in subset which is the Minim原创 2014-09-21 20:16:18 · 433 阅读 · 0 评论 -
Theory:kmp 处理字符串
hdu2087:剪花布条Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8781 Accepted Submission(s): 5746Problem Description一块花布条,里面有些图案,原创 2014-09-23 20:45:47 · 390 阅读 · 0 评论 -
24点
#include #include #include using namespace std; const double PRECISION = 1E-6; const int COUNT_OF_NUMBER = 4; const int NUMBER_TO_BE_CAL = 24; double number[COUNT_OF_NUMBER]; string expression[COUNT_O原创 2014-09-19 12:59:31 · 457 阅读 · 0 评论 -
Theory:大小顶堆,排序,插入,删除
#include#include#include#includeusing namespace std;#define MAX 1000int heap_size, array[MAX];int left( int x ){ return x * 2 + 1;}int right( int x ){ return x * 2 + 2;}void swap ( in原创 2014-09-27 14:27:13 · 617 阅读 · 0 评论