摘要:Reusing Classes 有两种常用方式实现类的重用,组件(在新类中创建存在类的对象)和继承。 Composition syntax Every non-primitive object has a toString() method, and it’s called in special s 阅读全文
TIJ——Chapter Five:Initialization & Cleanup
2015-06-10 19:55 by 星星之火✨🔥, 358 阅读, 0 推荐, 收藏, 编辑
摘要:Method overloading |_Distinguishing overloaded methods If the methods hava the same name, how can Java know which method you mean? There's a simple ru 阅读全文
PAT复杂度_最大子列和问题、最大子列和变种
2015-06-06 19:47 by 星星之火✨🔥, 748 阅读, 0 推荐, 收藏, 编辑
摘要:01-复杂度1. 最大子列和问题给定K个整数组成的序列{ N1, N2, ..., NK },“连续子列”被定义为{ Ni, Ni+1, ..., Nj },其中 1 #define MAXN 100000int arr[MAXN+10];int main(void){ int i, j, k... 阅读全文
PAT自测_打印沙漏、素数对猜想、数组元素循环右移、数字加倍重排、机器洗牌
2015-06-06 17:48 by 星星之火✨🔥, 533 阅读, 0 推荐, 收藏, 编辑
摘要:00-自测1. 打印沙漏(20)本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印***** *** * ********所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号... 阅读全文
Design and Analysis of Algorithms_Decrease-and-Conquer
2015-06-05 15:24 by 星星之火✨🔥, 2783 阅读, 0 推荐, 收藏, 编辑
摘要:I collect and make up this pseudocode from the book:> _ Anany LevitinNote that throughout the paper, we assume that inputs to algorithms fall within t... 阅读全文