數據結構與演算法分析第三版答案
Ⅰ 求數據結構與演算法解析 這本書的習題答案 注意 答案 書有 沒習題答案 郁悶!
壓縮包已經發到你郵箱,請查收。接壓後即可觀看。有沒有分沒關系,重要的是對你有沒有幫助,如果是那樣的話,我不勝榮幸!祝你編程愉快!
Ⅱ 求書 《數據結構與演算法分析》pdf 第三版 維斯 著,張懷勇 等譯
Ⅲ 求數據結構與演算法分析——C++描述(第3版)習題答案~~
http://wenku..com/view/396c0c4c2e3f5727a5e9625f.html
Ⅳ 求《數據結構與演算法分析C++描述》 第三版 中文版電子版課後答案
http://down.51cto.com/data/101180
http://..com/share/.html
推薦下載網路的
Ⅳ 數據結構與演算法分析 廖明宏 答案
那,我也不知道是不是你說的答案,你自己看著辦吧。
貼了一部分 看看
第一章 緒論
1.16
void print_descending(int x,int y,int z)//按從大到小順序輸出三個數
{
scanf("%d,%d,%d",&x,&y,&z);
if(x<y) x<->y; //<->為表示交換的雙目運算符,以下同
if(y<z) y<->z;
if(x<y) x<->y; //冒泡排序
printf("%d %d %d",x,y,z);
}//print_descending
1.17
Status fib(int k,int m,int &f)//求k階斐波那契序列的第m項的值f
{
int tempd;
if(k<2||m<0) return ERROR;
if(m<k-1) f=0;
else if (m==k-1 || m==k) f=1;
else
{
for(i=0;i<=k-2;i++) temp=0;
temp[k-1]=1;temp[k]=1; //初始化
sum=1;
j=0;
for(i=k+1;i<=m;i++,j++) //求出序列第k至第m個元素的值
temp=2*sum-temp[j];
f=temp[m];
}
return OK;
}//fib
分析: k階斐波那契序列的第m項的值f[m]=f[m-1]+f[m-2]+......+f[m-k]
=f[m-1]+f[m-2]+......+f[m-k]+f[m-k-1]-f[m-k-1]
=2*f[m-1]-f[m-k-1]
所以上述演算法的時間復雜度僅為O(m). 如果採用遞歸設計,將達到O(k^m). 即使採用暫存中間結果的方法,也將達到O(m^2).
1.18
typedef struct{
char *sport;
enum{male,female} gender;
char schoolname; //校名為'A','B','C','D'或'E'
char *result;
int score;
} resulttype;
typedef struct{
int malescore;
int femalescore;
int totalscore;
} scoretype;
void summary(resulttype result[ ])//求各校的男女總分和團體總分,假設結果已經儲存在result[ ]數組中
{
scoretype score[MAXSIZE];
i=0;
while(result.sport!=NULL)
{
switch(result.schoolname)
{
case 'A':
score[ 0 ].totalscore+=result.score;
if(result.gender==0) score[ 0 ].malescore+=result.score;
else score[ 0 ].femalescore+=result.score;
break;
case 'B':
score[ 0 ].totalscore+=result.score;
if(result.gender==0) score[ 0 ].malescore+=result.score;
else score[ 0 ].femalescore+=result.score;
break;
…… …… ……
}
i++;
}
for(i=0;i<5;i++)
{
printf("School %d:\n",i);
printf("Total score of male:%d\n",score.malescore);
printf("Total score of female:%d\n",score.femalescore);
printf("Total score of all:%d\n\n",score.totalscore);
}
}//summary
1.19
Status algo119(int a[ARRSIZE])//求i!*2^i序列的值且不超過maxint
{
last=1;
for(i=1;i<=ARRSIZE;i++)
{
a[i-1]=last*2*i;
if((a[i-1]/last)!=(2*i)) reurn OVERFLOW;
last=a[i-1];
return OK;
}
}//algo119
分析:當某一項的結果超過了maxint時,它除以前面一項的商會發生異常.
1.20
void polyvalue()
{
float temp;
float *p=a;
printf("Input number of terms:");
scanf("%d",&n);
printf("Input value of x:");
scanf("%f",&x);
printf("Input the %d coefficients from a0 to a%d:\n",n+1,n);
p=a;xp=1;sum=0; //xp用於存放x的i次方
for(i=0;i<=n;i++)
{
scanf("%f",&temp);
sum+=xp*(temp);
xp*=x;
}
printf("Value is:%f",sum);
}//polyvalue
Ⅵ 誰有數據結構與演算法分析:C語言描述高清版或者課後習題的答案
書特點如下:
●專用一章來討論演算法設計技巧,包括貪婪演算法、分治演算法、動態規劃、隨機化演算法以及回溯演算法
●介紹了當前流行的論題和新的數據結構,如斐波那契堆、斜堆、二項隊列、跳躍表和伸展樹
●安排一章專門討論攤還分析,考查書中介紹的一些高級數據結構
●新開辟一章討論高級數據結構以及它們的實現,其中包括紅黑樹、自頂向下伸展樹。treap樹、k-d樹、配對堆以及其他相關內容
●合並了堆排序平均情況分析的一些新結果
目錄
出版者的話
專家指導委員會
譯者序
前言
第1章 引論
第2章 演算法分析
第3章 表、棧和隊列
第4章 樹
第5章 散列
第6章 優先隊列(堆)
第7章 排序
第8章 不相交集ADT
第9章 圖論演算法
第10章 演算法設計技巧
第11章 攤還分析
第12章 高級數據結構及其實現索引。
Ⅶ 求參考答案 高等教育 演算法與數據結構 第三版 張乃孝
有專門的習題解答,買一本吧
Ⅷ 誰有<數據結構與演算法分析 c++描述>(3)的書後答案
上網找
Ⅸ 數據結構與演算法 c++ 第三版 習題答案
用迅雷搜索,上面有好多的