Author Archives: coder4

《数据结构》读书笔记 第五章 行逻辑稀疏矩阵

写得好费劲啊。找了半天错,最后发现是rpos初始化出错了。
Matrix.h:行逻辑稀疏矩阵的基本操作
enum Statuses{WRONG=-1,OK=0};
enum Max{MAX_SIZE=100,MAX_RC=20};
typedef int Status;
typedef int Elem;
typedef struct
{
 int i,j;
 Elem e;
}Triple;
typedef struct
{
 int mu,n[......]

继续阅读

《数据结构》读书笔记 第五章 矩阵的顺序三元表存储

开始恢复写程序了,快正常了~这次的程序很难的,而且系列性啊……最让我惊诧的是看到了别人的减法算法,太牛了……
Matrix.h:定义了基本操作
#include <iostream>
using namespace std;
enum {OK=-1,WRONG=0,MAX=100};
typedef int Status;
typedef int Elem;
struct Triple
{
 int i,j;[......]

继续阅读

《数据结构》读书笔记 第五章 数组的顺序存储实现

昨天读《The C++ Programing Language Special Edition》确实觉得注释是很重要的,所以今天开始所有程序都要练习注释,尽量写出好的注释来:-)
Array.h : 定义了数组的顺序存储的基本操作
#include <iostream>
#include <cstdarg>
typedef int Elem;
typedef int Status;
enum {WRONG=-1,OK=0};
struct Array
{
/*-[......]

继续阅读