freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

最新上半軟件設(shè)計師下午卷試題及答案解析(編輯修改稿)

2024-07-22 01:20 本頁面
 

【文章內(nèi)容簡介】 和變量說明 n:長鋼條的長度 P[]:價格數(shù)組 */ define LEN 100 int Top_Down_ Cut_Rod(int P[],int n){/*自頂向下*/ Int r=0 Int i; if(n=0){ retum 0; } for(i=1;(1);i++){ int tmp=p[i]+Top_Down_ Cut_Rod(p,ni) r=(r=tmp)?r:tmp; } return r; } int Bottom_Up_Cut_Road(int p[],int n){ /*自底向上*/ int r[LEN]={0}。 int temp=0。 int i,j。 for(j=1。j=n。j++){ temp=0。 for(i=l。(2)。i++){ temp=(3)。 } (4) } return r[n]。 } 【問題 1】(8 分) 根據(jù)說明,填充 C 代碼中的空(1)~(4)。 【問題 2】(7 分) 根據(jù)說明和 C 代碼,算法采用的設(shè)計練略為(5)。 求解時,自頂向下方法的時間復(fù)雜度為(6);自底向上方法的時間復(fù)雜度為(7)(用 O 表示)。 從下列的 2 道試題(試題五至試題六)中任選 1 道解答。請在答題紙上的指定位置處將所選擇試題的題號框涂黑。若多涂或者未涂題號框,則對題號最小的一道試題進行評分。 試題五(共 15 分) 閱讀下列說明和 C++代碼,將應(yīng)填入(n)處的字句寫在答題紙的對應(yīng)欄內(nèi)。 【說明】 生成器( Builder)模式的意圖是將一個復(fù)雜對象的構(gòu)建與它的表示分離,使得同樣的構(gòu)建過程可以創(chuàng)建不同的表示。圖 51 所示為其類圖。 【 C++ 代 碼 】 include iostream include string using namespace std。 class Product { private: string partA, partB。 public: Product(){ } void setPartA(const stringamp。s){ PartA=s。} void setPartB(const stringamp。s){ PartB=s。} ∥其余代碼省略 }。 class Builder{ public: (1)。 virtual void buildPartB()=0。 (2)。 }。 class ConcreteBuilder1: public Builder{ private: Product* product。 public: ConcreteBuilder1(){product=new Product()。 } void buildPartA(){ (3)(Component A)。} void buildPartB(){ (4)(Component B)。} Product*getResult(){ return product。} ∥其余代碼省略 }。 class ConcreteBuilder2: public Builder{ /*代碼省略*/ }。 class Director { private: Builder* builder。 public: Director(Builder*pBuilder){builder*
點擊復(fù)制文檔內(nèi)容
研究報告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1