上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页
摘要: 1、局部静态变量(1)生存期:存储在静态数据区,本模块运行结束不会销毁,程序结束时才销毁。(2)初始化:当且仅当本模块初次运行时初始化。2、外部静态变量/静态函数限制全局变量的作用域为本文件。3、静态数据成员/成员函数表示该成员/成员函数属于此类,不依附与具体对象。常用于生成对象的计数器。 阅读全文
posted @ 2014-12-18 10:20 陆草纯 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 形式:在成员函数后面加上const限定词,表示不会修改对象内容。例如Circle类:class Circle{ double r;public: Circle(double newr) { r = newr; } double get_r() const ... 阅读全文
posted @ 2014-12-18 09:51 陆草纯 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ... 阅读全文
posted @ 2014-12-17 23:01 陆草纯 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Valid SudokuDetermine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are ... 阅读全文
posted @ 2014-12-17 22:45 陆草纯 阅读(6174) 评论(2) 推荐(1) 编辑
摘要: Fraction to Recurring DecimalGiven two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the ... 阅读全文
posted @ 2014-12-17 22:25 陆草纯 阅读(4454) 评论(0) 推荐(0) 编辑
摘要: Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r... 阅读全文
posted @ 2014-12-16 17:17 陆草纯 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum... 阅读全文
posted @ 2014-12-16 15:11 陆草纯 阅读(2993) 评论(0) 推荐(0) 编辑
摘要: First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo... 阅读全文
posted @ 2014-12-15 14:39 陆草纯 阅读(375) 评论(0) 推荐(0) 编辑
摘要: Trapping Rain WaterGivennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to tr... 阅读全文
posted @ 2014-12-15 14:17 陆草纯 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac... 阅读全文
posted @ 2014-12-14 10:39 陆草纯 阅读(8020) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页