摘要: 1 #include <stdio.h> 2 // Q1.Write a recursive function that 3 // merges two sorted arrays into another array 4 void Merge(int a[], int n1, int b[], int n2, int c[]) 5 { 6 if(n1 != 0 && n2 != 0) 7 { 8 if (a[n1-1] < b[n2-1]) 9 {10 c[n1 + n2 -1] = b[n2-1];11 Merge(a, n1, b, n2-1, c);1 阅读全文
posted @ 2011-07-23 08:52 Mayus 阅读(150) 评论(0) 推荐(0)
摘要: ● Meaning “many forms”, polymorphism in OO terminology means a single statement in codethat might do different things depending on the context in which it isexecuted. ○ In thiscase, rpt[i]->Display() is a polymorphic call (when Display() is a virtual function). ○ Dependingon what kind of object w 阅读全文
posted @ 2011-06-28 12:15 Mayus 阅读(226) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 #define DEBUGBUILD 0 6 #define DEBUG if (DEBUGBUILD) cout 7 8 class Date { 9 private: 10 int day; 11 int month; 12 int year; 13 public: 14 Date() { DEBUG << "Date: default ctor" << endl; } 15 Date( 阅读全文
posted @ 2011-06-28 12:08 Mayus 阅读(198) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 #define DEBUGBUILD 0 6 #define DEBUG if (DEBUGBUILD) cout 7 8 class Date{ 9 private: 10 int day, month, year; 11 public: 12 Date(){ DEBUG << "Date: default ctor" << endl;} 13 Date(int m, int d, int 阅读全文
posted @ 2011-06-28 10:15 Mayus 阅读(235) 评论(0) 推荐(0)
摘要: 2011@US 阅读全文
posted @ 2011-06-28 10:04 Mayus 阅读(129) 评论(0) 推荐(0)