05 2018 档案
摘要:#include "assert.h"#include using namespace std;void Sort(int *a,int n){ int i=0,j=0,k=n-1; while(j""> n; int * a= new int[n]; f...
阅读全文
摘要:#include #include using namespace std;typedef int E;typedef char T;const int maxWeight=1000;class Graph{private: T *verticesList; ...
阅读全文
摘要:#include using namespace std;class Stack{private: int top,maxSize; int *element;public: Stack(int sz){ top=0; m...
阅读全文
摘要:#include #include using namespace std;const int DefaultVertices=100;const int maxWeight=1000;typedef int E;typedef char T;class Graphm...
阅读全文
摘要:#include using namespace std;struct TreeNode{ char value; TreeNode *leftChild; TreeNode *rightChild; TreeNode():leftChild(...
阅读全文
摘要:#include #include using namespace std;const int DefaultVertices=100;const int maxWeight=1000;typedef int E;typedef char T;class Graphm...
阅读全文
摘要:稀疏矩阵的压缩存储:实现稀疏矩阵压缩存储,并实现矩阵转置和求和。输入矩阵时,首先需要输入非零元素的个数,然后分别输入矩阵的 行号,列号和值。输完2个矩阵后,自动进行计算第一个矩阵的转置以及两个矩阵的和。例如:输入如下:100 90 5 //矩阵的行数为100,列数为9...
阅读全文
摘要:实现二叉树的基本操作:建立、遍历、计算深度、结点数、叶子数等。输入C,先序创建二叉树,#表示空节点;输入H:计算二叉树的高度;输入L:计算二叉树的叶子个数;输入N:计算二叉树节点总个数;输入1:先序遍历二叉树;输入2:中序遍历二叉树;输入3:后续遍历二叉树;输入F:查...
阅读全文

浙公网安备 33010602011771号