# 算法第一章作业

## 一、编码规范

### 注释

#### 注释风格

///* */ 都可以; 但 // 常用. 要在如何注释及注释风格上确保统一.

### 函数注释

#### 函数声明

• 函数的输入输出.

• 对类成员函数而言: 函数调用期间对象是否需要保持引用参数, 是否会释放这些参数.

• 函数是否分配了必须由调用者释放的空间.

• 参数是否可以为空指针.

• 是否存在函数使用上的性能隐患.

• 如果函数是可重入的, 其同步前提是什么?

 // Returns an iterator for this table.  It is the client's // responsibility to delete the iterator when it is done with it, // and it must not use the iterator once the GargantuanTable object // on which the iterator was created has been deleted. // // The iterator is initially positioned at the beginning of the table. // // This method is equivalent to: //    Iterator* iter = table->NewIterator(); //    iter->Seek(""); //    return iter; // If you are going to immediately seek to another place in the // returned iterator, it will be faster to use NewIterator() // and avoid the extra seek. Iterator* GetIterator() const;

 // Returns true if the table cannot hold any more entries. bool IsTableFull();

### 类数据成员

 private:  // Used to bounds-check table accesses. -1 means  // that we don't yet know how many entries the table has.  int num_total_entries_;

### 全局变量

 // The total number of tests cases that we run through in this regression test. const int kNumTestCases = 6;

## 二、数学之美与算法

### 数学之美 PageRank章节

posted @ 2020-09-15 23:40  幼儿算数  阅读(147)  评论(0编辑  收藏  举报