chenxi16

导航

2020年4月6日 #

数据结构1-05-树9 Huffman Codes

摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 1001 4 struct node{ 5 int data,left,right,parent; 6 node(){ 7 data = -1; 8 left = -1; 9 right= 阅读全文

posted @ 2020-04-06 17:46 chenxi16 阅读(120) 评论(0) 推荐(0) 编辑

数据结构1 - 01-复杂度1 最大子列和问题

摘要: 1 #include<stdio.h> 2 #define MAXK 1000000 3 int a[MAXK],dp[MAXK],k; 4 int main(){ 5 int i,maxsum; 6 scanf("%d",&k); 7 for(i=0;i<k;i++){ 8 scanf("%d", 阅读全文

posted @ 2020-04-06 10:02 chenxi16 阅读(177) 评论(0) 推荐(0) 编辑

数据结构-1 01-复杂度2 Maximum Subsequence Sum

摘要: 1 #include<stdio.h> 2 #define MAXK 10001 3 int k,a[MAXK],dp[MAXK],start[MAXK],end[MAXK]; 4 int main(){ 5 int i,j; 6 scanf("%d",&k); 7 for(i=0;i<k;i++) 阅读全文

posted @ 2020-04-06 09:49 chenxi16 阅读(181) 评论(0) 推荐(0) 编辑