[Data structures]Find artificulation

2019-7-24 写技术

#include <stdio.h> #include <stdlib.h> #define MAX 20 #define INFINIT 65535 typedef struct _ArcCell{ int adj; // Weight or flag about connection int *info; // Other information }ArcCell; typedef char VertexType; typedef enum{ DG, DN, UDG, UDN }GraphKind; ty...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1181)

[Data structures]Minimum cost spanning tree (prim and kruskal)

2019-7-23 写技术

#include <stdio.h> #include <stdlib.h> #define MAX 20 #define INFINIT 65535 typedef struct _ArcCell{ int adj; // Weight or flag about connection int *info; // Other information }ArcCell; typedef char VertexType; typedef enum{ DG, DN, UDG, UDN }GraphKind; ty...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1137)

[Data structures]Depth first search forest

2019-7-23 写技术

#include <stdio.h> #include <stdlib.h> #define MAX 20 #define INFINIT 65535 typedef struct _ArcCell{ int adj; // Weight or flag about connection int *info; // Other information }ArcCell; typedef char VertexType; typedef enum{ DG, DN, UDG, UDN }GraphKind; ty...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1097)

[Data structures]Graph travers (DFS and BFS)

2019-7-23 写技术

#include <stdio.h> #include <stdlib.h> #define MAX 20 #define INFINIT 65535 typedef struct _ArcCell{ int adj; // Weight or flag about connection int *info; // Other information }ArcCell; typedef char VertexType; typedef enum{ DG, DN, UDG, UDN }GraphKind; ty...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1175)

[Data structures]Hash table

2019-7-17 写技术

#include <stdio.h> #include <stdlib.h> #define NULLKEY -1 int hashsize[] = {10, 20, 40, 100, 1024}; typedef struct _HashTable{ int *elem; int count; // count of the elements of the table now; int sizeIndex; // hashsize[sizeIndex] is the size of the table now; }HashTabl...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1101)

[Data structures]Digital search tree - Trie tree

2019-7-16 写技术

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define MAX_LEN 8 typedef struct _TrieTree{ int kind; // 0-leaf; 1-branch union{ struct {char keys[MAX_LEN]; char *infoptr;} leaf; struct {struct _TrieTree *ptr[27]; int num;} bra...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1272)

[Data structures]Digital search tree - Double link tree

2019-7-15 写技术

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> typedef struct _DLTree{ char symbol; // key struct _DLTree *next; int kind; // 0-leaf; 1-branch union{ char *infoptr; //Pointer to the data struct _DLTree *first; }; }DLTree; ...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1032)

[Data structures]B-Tree

2019-7-12 写技术

#include <stdio.h> #include <stdlib.h> #include <math.h> #define m 3 typedef struct _BTree{ int keynum; struct _BTree *parent; //Record *data[m+1]; /* Begin from 1 */ int key[m+1]; /* Begin from 1 */ struct _BTree *child[m+1]; /* Begin from 0 */ }BTree; ...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1117)

[Data structures]Balance binary search tree (AVL)

2019-7-9 写技术

#include <stdio.h> #include <stdlib.h> typedef struct _BinaryTree{ int key; int bf; struct _BinaryTree *left; struct _BinaryTree *right; }BinaryTree; void R_Rotate(BinaryTree **T) { BinaryTree *lc; lc = (*T)->left; (*T)->left = lc->right; lc->right = ...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1126)

[Data structures]Binary search tree

2019-7-5 写技术

#include <stdio.h> #include <stdlib.h> typedef struct _BinaryTree{ int key; struct _BinaryTree *left; struct _BinaryTree *right; }BinaryTree; int searchBST(BinaryTree *T, int key, BinaryTree *f, BinaryTree **p) { if(T == NULL){ *p = f; return 0; } if(T->key ...

阅读全文>>

标签: Data Structures data_structures

评论(0) 浏览(1183)

Powered by anycle 湘ICP备15001973号-1