随笔分类 - Data Structure for 845 of Nanjing University
摘要:#include<cstdio> #include<vector> #include<algorithm> using namespace std; struct TNode{ int value = -1; TNode *left = NULL; TNode *right = NULL; }; v
        阅读全文
                
摘要:#include<cstdio> #include<algorithm> using namespace std; typedef struct TNode{ int value; TNode *left=NULL; TNode *right=NULL; int hight; }*alvTree,*
        阅读全文
                
摘要:#include<cstdio> #include<queue> using namespace std; struct TNode{ int value=-1; TNode *left=NULL; TNode *right=NULL; }; void preOrder(TNode *root){ 
        阅读全文
                
摘要:SparseMatrix.h #pragma once #include<iostream> using namespace std; class Tri { public: int col; int row; int value; }; class SparseMatrix { public: i
        阅读全文
                
摘要:SparsrMatrix.h #pragma once #include<iostream> using namespace std; class Tri { public: int row; int col; int value; }; class SparseMatrix { public: i
        阅读全文
                
摘要:Stack.h #pragma once #include<iostream> using namespace std; class SNode { public: char data; SNode* next; }; class Stack { public: SNode* top; Stack(
        阅读全文
                
摘要:原题是正整数的转换,只能练习到栈。但小数部分恰好是队列实现的,所以加上小数部分,可以一道题练习一整章的核心知识点 Stack.h #pragma once #include<iostream> using namespace std; class Stack { public: int* eleme
        阅读全文
                
摘要:DoubleStack.h #pragma once #include<iostream> using namespace std; class DoubleStack { public: int* V; int top[2]; int maxSize; //由于题目没要求,就不写栈满处理函数了,数
        阅读全文
                
摘要:LinkList.h #pragma once #include<iostream> using namespace std; class LNode { public: int data; LNode* next; }; class LinkList { public: LNode* first;
        阅读全文
                
摘要:SeqList.h #pragma once #include<iostream> using namespace std; class SeqList { public: int* elements; int maxSize; int len; SeqList(int size = 30) { m
        阅读全文
                
摘要:Stack.h #pragma once #include<iostream> using namespace std; class Stack { public: int* elements; int top; int maxSize; Stack(int size = 5) { maxSize 
        阅读全文
                
摘要:LinkQueue.h #pragma once #include<iostream> using namespace std; class QueueNode { public: int data; QueueNode* next; }; class LinkQueue { public: Que
        阅读全文
                
摘要:Queue.h #pragma once #include<iostream> using namespace std; class Queue { public: int front; int rear; int maxSize; int* elements; Queue(int size=20)
        阅读全文
                
摘要:Queue.h #pragma once #include<iostream> using namespace std; class Queue { public: int front, rear; int* elements; int maxSize; Queue(int size = 10) {
        阅读全文
                
摘要:#include<iostream> using namespace std; class LNode { public: int data; LNode* next; }; class LinkList { public: LNode* first; LinkList() { first = ne
        阅读全文
                
摘要:#include<iostream> using namespace std; long factorial(long n) { if (n == 0) { return 1; } else { return n*factorial(n - 1); } } int main() { cout << 
        阅读全文
                
摘要:LNode.h #pragma once class LNode { friend class LinkStack; int data; LNode* next; }; LinkStack.h #pragma once #include"LNode.h" #include<iostream> usi
        阅读全文
                
摘要:LinkStack.h #pragma once #include<iostream> using namespace std; class LNode { public: int data; LNode* next; }; class LinkStack { public: LNode* top;
        阅读全文
                
摘要:ShareStack.h #pragma once #include<iostream> using namespace std; class ShareStack { public: int* v; int maxSize; int top[2]; int bottom[2]; ShareStac
        阅读全文
                
摘要:SeqStack.h #pragma once #include<iostream> using namespace std; class SeqStack { public: int* elements; int maxSize; int top; SeqStack(int size = 10) 
        阅读全文
                
                    
                
浙公网安备 33010602011771号