![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++ -- 数据结构
zimuxiaxi
这个作者很懒,什么都没留下…
展开
-
线性链表(面向过程)--2011.11.13
#include<stdio.h> #include<string> #include<stdlib.h> #define MAX 10 typedef struct Node { char cData[MAX]; struct Node *pNext; }*Linklist; int nChoice(); void v...2012-11-05 10:47:57 · 92 阅读 · 0 评论 -
线性链表简单回顾(面向对象)
挺久没写了,学的也很浅,如果写错了希望帮忙指正,谢谢! Node.h #include<iostream> #ifndef NODE #define NODE using namespace std; class Node { public: int iValue;//default type is private Node *next; ...2012-11-05 11:48:15 · 89 阅读 · 0 评论 -
哈夫曼编码--贪心算法
#include<iostream> using namespace std; #define MAX 1001 #define INF 99999999 struct stuTreeNode { int nFr; int nLeft; int nRight; }; struct stuNodeTow { int nA; int...2012-11-07 21:49:02 · 132 阅读 · 0 评论 -
最长上升子序列-动态规划
题目: 设有一个正整数的序列:d1,d2,…,dn,对于下标i1<i2<…<im,若有di1≤di2≤…≤dim 则称存在一个长度为m的上升序列。 例如,下列数列 13 7 9 16 38 24 37 18 44 19 21 22 63 15 对于下标i1=1,i2=4,i3=5,i4=9,i5=13,满足13<16...2012-11-12 15:53:15 · 125 阅读 · 0 评论 -
最长不下降子序列O(nlogn) --动态规划
题目: 设有一个正整数的序列:d1,d2,…,dn,对于下标i1<i2<…<im,若有di1≤di2≤…≤dim 则称存在一个长度为m的不下降序列。 例如,下列数列 13 7 9 16 38 24 37 18 44 19 21 22 63 15 对于下标i1=1,i2=4,i3=5,i4=9,i5=13,满足13<16<38...2012-11-12 16:40:18 · 178 阅读 · 0 评论 -
简单DFS
#include <stdio.h> const int MAX = 101; const int CONTACT = 1; const int vist_true = 1; const int vist_false = 0; void vInputGraphNode(int iNum,int iGraph[MAX][MAX]); void vDealData...2012-11-18 22:53:20 · 133 阅读 · 0 评论