摘要:
namespace DSList{ public interface IListDS<T> { int GetLength(); //求长度 bool IsEmpty(); //判断线性表是否为空 void Clear(); //清空操作 void Append(T item); //追加操作 void Insert(int pos, T item); //插入操作 T Remove(int pos); //删除操作 T GetElem(int pos); //取表元 int L... 阅读全文
posted @ 2013-04-26 15:54
小泥巴1024
阅读(101)
评论(0)
推荐(0)
摘要:
namespace DSList{ public partial class SeqList<T> : IListDS<T> where T:IComparable<T> { //fields private T[] data; private int last; private int maxsize; //properties public T this[int index] { get { return data[index]; } set { data[index] = value; ... 阅读全文
posted @ 2013-04-26 15:44
小泥巴1024
阅读(757)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class Node<T> { // fields private T data; //Data domain private Node<T> next; //Next reference domain // properties public T Data { get { return data; } set { data = value; } } public Node<T> Next { get ... 阅读全文
posted @ 2013-04-26 15:41
小泥巴1024
阅读(151)
评论(0)
推荐(0)
摘要:
namespace DSList{ public partial class LinkList<T> : IListDS<T> where T:IComparable<T> { //fields private Node<T> head; //property public Node<T> Head { get { return head; } set { head = value; } } //constructor public LinkList() { head = nul... 阅读全文
posted @ 2013-04-26 15:40
小泥巴1024
阅读(109)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class DbNode<T> { /// <summary> /// fields /// </summary> private DbNode<T> prev; //Previous reference domain private T data; //Data domain private DbNode<T> next; //Next reference domain /// <summary> /// properties /// </summary> p 阅读全文
posted @ 2013-04-26 15:39
小泥巴1024
阅读(108)
评论(0)
推荐(0)
摘要:
namespace DSList{ public partial class DbLinkList<T> : IListDS<T> where T : IComparable<T> { private DbNode<T> head; //Head reference domain //Head property public DbNode<T> Head { get { return head; } set { head = value; } } //Constructor public D... 阅读全文
posted @ 2013-04-26 15:37
小泥巴1024
阅读(122)
评论(0)
推荐(0)
摘要:
namespace DSList{ public interface IStack<T> { int GetLength(); //求栈的长度 bool IsEmpty(); //判断栈是否为空 void Clear(); //清空操作 void Push(T item); //入栈操作 T Pop(); //出栈操作 T GetTop(); //取栈顶元素 }} 阅读全文
posted @ 2013-04-26 15:35
小泥巴1024
阅读(138)
评论(0)
推荐(0)
摘要:
namespace DSList{ public partial class SeqStack<T> : IStack<T> where T:IComparable<T> { /// <summary> /// fields /// </summary> private int maxsize; private T[] data; private int top; /// <summary> /// properties /// </summary> public int Maxsize { get { ret 阅读全文
posted @ 2013-04-26 10:50
小泥巴1024
阅读(100)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class LinkStack<T> : IStack<T> { //Fields private Node<T> top; //Top reference indicator private int num; //Node quantity //Properties public Node<T> Top { get { return top; } set { top = value; } } public int Num ... 阅读全文
posted @ 2013-04-26 10:48
小泥巴1024
阅读(151)
评论(0)
推荐(0)
摘要:
namespace DSList{ public interface IQueue<T> { int GetLength(); //求队列的长度 void Clear(); //清空操作 bool IsEmpty(); //判断是否为空 void In(T item); //入队操作 T Out(); //出队操作 T GetFront(); //取队头元素 }} 阅读全文
posted @ 2013-04-26 10:47
小泥巴1024
阅读(110)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class CSeqQueue<T> : IQueue<T> { //Fields private int maxsize; private T[] data; private int front; private int rear; private int count; //Properties public T this[int index] { get { return data[index]; } set { data[index] = ... 阅读全文
posted @ 2013-04-26 10:37
小泥巴1024
阅读(121)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class LinkQueue<T> : IQueue<T> { //Fields private Node<T> front; private Node<T> rear; private int count; //Properties public Node<T> Front { get { return front; } set { front = value; } } public Node<T> Rear { get ... 阅读全文
posted @ 2013-04-26 10:36
小泥巴1024
阅读(96)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class StringDS { //Field private char[] data; //Properties public char this[int index] { get { return data[index]; } set { data[index] = value; } } //Constructors public StringDS(char[] arr) { data = new char[arr.L... 阅读全文
posted @ 2013-04-26 10:33
小泥巴1024
阅读(114)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class TreeNode<T> { private T data; private TreeNode<T> lChild; private TreeNode<T> rChild; public T Data { get { return data; } set { data = value; } } public TreeNode<T> LChild { get { return lChild; } ... 阅读全文
posted @ 2013-04-26 10:26
小泥巴1024
阅读(152)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class BinaryTree<T> where T:IComparable<T> { //Field private TreeNode<T> head; //Property public TreeNode<T> Head { get { return head; } set { head = value; } } //Constructors public BinaryTree(T val, TreeNode<T> lc, TreeNo... 阅读全文
posted @ 2013-04-26 10:24
小泥巴1024
阅读(127)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class HfmNode { private int flag; //标记 private int weight; //权植 private int lChild; //左孩子下标 private int rChild; //右孩子下标 private int parent; //双亲结点下标 public int Flag { get { return flag; } set { flag = value; } ... 阅读全文
posted @ 2013-04-26 10:23
小泥巴1024
阅读(109)
评论(0)
推荐(0)
摘要:
namespace DSList{ public class HuffmanTree { private HfmCode[] hfmCode; private HfmNode[] hfmNode; public HfmCode getHfmCode(int index) { return hfmCode[index]; } public void setHfmCode(int index,HfmCode hfcode) { hfmCode[index] = hfcode; } public HfmNode getHfmNode(int ind... 阅读全文
posted @ 2013-04-26 10:18
小泥巴1024
阅读(124)
评论(0)
推荐(0)
摘要:
namespace DSList{ public interface IGraph<T> { int GetNumOfVertex(); //获取顶点的数目 int GetNumOfEdge(); //获取边的数目 bool IsGvNode(GvNode<T> v); //v是否为图的顶点 int GetIndex(GvNode<T> v); //获得顶点V在顶点数组中的索引 void SetEdge(GvNode<T> v1, GvNode<T> v2, int v); //在顶点v1和v2之间添加权值为v的边 void DelE 阅读全文
posted @ 2013-04-26 10:17
小泥巴1024
阅读(100)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向图邻接矩阵的顶点结点类(Undirected Graph Adjaceney Matrix of Vertex Node) public class GvNode<T> { private T data; public T Data { get { return data; } set { data = value; } } public GvNode(T val) { data = val; } }} 阅读全文
posted @ 2013-04-26 10:16
小泥巴1024
阅读(140)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向图邻接矩阵类(Undirected Graph Adjacency Matrix Class) public class GraphAdjMatrix<T> : IGraph<T> { //Fields private GvNode<T>[] nodes; //vertex array private int numEdges; //Edges number private int[,] matrix; //Matrix array //Constructor public GraphAdjMatrix(int . 阅读全文
posted @ 2013-04-26 10:12
小泥巴1024
阅读(158)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向图邻接表的邻接结点类(Undirected Graph Adjacency List of Adjaceney Node) public class AdjListNode<T> { private int adjVex; private AdjListNode<T> next; private int weight; public int AdjVex { get { return adjVex; } set { adjVex = value; } } ... 阅读全文
posted @ 2013-04-26 10:11
小泥巴1024
阅读(159)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向图邻接表的顶点结点类(Undirected Graph Adjacency List of Vertex Node) public class ALVexNode<T> { private GvNode<T> data; private AdjListNode<T> firstAdj; public GvNode<T> Data { get { return data; } set { data = value; } } public AdjListNod... 阅读全文
posted @ 2013-04-26 10:10
小泥巴1024
阅读(160)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向图邻接表类(Undirected Graph Adjacency List Class) public class GraphAdjList<T> : IGraph<T> { //Fields private ALVexNode<T>[] adjList; //Vertex array private int[] visited; //Auxiliary array of DFS() or BFS() //Property public ALVexNode<T> this[int index] { ge 阅读全文
posted @ 2013-04-26 10:09
小泥巴1024
阅读(173)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向网邻接矩阵类(Undirected Net Adjacency Matrix Class) public class NetAdjMatrix<T> : IGraph<T> { //Fields private GvNode<T>[] nodes; private int numEdges; private int[,] matrix; //Constructor public NetAdjMatrix(int n) { nodes = new GvNode<T>[n]; matrix = new in 阅读全文
posted @ 2013-04-26 10:07
小泥巴1024
阅读(170)
评论(0)
推荐(0)
摘要:
namespace DSList{ //有向网邻接矩阵类(Directed Net Adjacency Matrix Class) public class DireNetAdjMatrix<T> : IDireGraph<T> { //Fields private GvNode<T>[] nodes; //有向网的顶点数组 private int numArcs; //弧的数目 private int[,] matrix; //邻接矩阵数组 //Constructor public DireNetAdjMatrix(int n) { nodes ... 阅读全文
posted @ 2013-04-26 10:06
小泥巴1024
阅读(244)
评论(0)
推荐(0)
摘要:
namespace DSList{ //无向网邻接表类(Undirected Net Adjacency List Class) public class NetAdjList<T> : IGraph<T> { //Field private ALVexNode<T>[] adjList; //vertex array //Property public ALVexNode<T> this[int index] { get { return adjList[index]; } set { adjList[i... 阅读全文
posted @ 2013-04-26 10:04
小泥巴1024
阅读(245)
评论(0)
推荐(0)
摘要:
namespace DSList{ //有向网邻接表类(Directed Net Adjacency List Class) public class DireNetAdjList<T> : IDireGraph<T> { //Field private ALVexNode<T>[] adjList; //Property public ALVexNode<T> this[int index] { get { return adjList[index]; } set { adjList[index] = val... 阅读全文
posted @ 2013-04-26 10:02
小泥巴1024
阅读(118)
评论(0)
推荐(0)
摘要:
namespace DSList{ //有向图邻接矩阵类(Directed Graph Adjacency Matrix Class) public class DireGraAdjMatrix<T> : IDireGraph<T> { //Fields private GvNode<T>[] nodes; private int numArcs; private int[,] matrix; //Constructor public DireGraAdjMatrix(int n) { nodes = new GvNode<T>[n]; numA 阅读全文
posted @ 2013-04-26 10:01
小泥巴1024
阅读(141)
评论(0)
推荐(0)
摘要:
namespace DSList{ //有向图邻接表类(Directed Graph Adjacency List Class) public class DireGraAdjList<T> : IDireGraph<T> { private ALVexNode<T>[] adjList; public ALVexNode<T> this[int index] { get { return adjList[index]; } set { adjList[index] = value; } } publi... 阅读全文
posted @ 2013-04-26 10:00
小泥巴1024
阅读(124)
评论(0)
推荐(0)
摘要:
namespace DSList{ //有向图接口类 public interface IDireGraph<T> { int GetNumOfVertex(); //获取顶点的数目 int GetNumOfArc(); //获取弧的数目 bool IsGvNode(GvNode<T> v); //v是否为图的顶点 int GetIndex(GvNode<T> v); //获得顶点V在顶点数组中的索引 void SetArc(GvNode<T> v1, GvNode<T> v2, int v); //在顶点v1和v2之间添加权值为v的 阅读全文
posted @ 2013-04-26 09:59
小泥巴1024
阅读(105)
评论(0)
推荐(0)
浙公网安备 33010602011771号