- 博客(5)
- 收藏
- 关注
原创 动态规划基础
本文来自于《算法导论》第二版第十五章动态规划部分的读书笔记。理论部分动态规划技术所适用的问题是什么? Dynamic Programming typically applies to optimization problems in which a set of choices must be made in order to arrive at an optimal solution.
2016-10-30 16:08:10 439
原创 线性表之顺序表的实现
本文针对顺序表,总结其相应的常用操作。主要是给出代码实现。结构、常量声明common.h#ifndef common_H#define common_H/* 函数结果状态码 */#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1//#define OVERFLOW -2/* 类型定义
2016-10-17 20:08:11 458
原创 Introduction to Programming with c++ 10-2 replace strings and split strings
课本学习P376,find函数以及replace函数。 find函数及其用法: unsigned find( string s ) // Returns the position of the first matching substring s unsigned find( string s, int index ) // Return the position of th
2016-10-15 08:23:32 297
原创 Introduction to Programming with c++ 10-1 stringstream使用
课本学习主要是熟悉stringsteam常用的几个例子。 P378页 stringstream provides an interface to manipulate strings as if they were input/ouput streams.代码第一个例子,主要用来实现字符串和浮点数(整数)的相互转换#include <iostream>#include <string
2016-10-12 22:59:28 372
原创 Introduction to Programming with c++ 9-2 一个标准的基于对象的入门例子
课本学习P345页,给了一个关于TV对象的例子。优点:channel, volume两个属性的设置均需要对另外一个属性的基础上。通过返回值表明,函数执行的成功与否代码#include <iostream>/*电视频道1-120声音为1-20电视默认开机在频道1,声音为0*/class TV{public: TV() : channel_(1), volume_(0), on_
2016-10-11 22:53:39 514
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人