[Data structures]Topological sort

2019-7-25 写技术

#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) 浏览(1067)

[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) 浏览(1004)

[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) 浏览(986)

[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) 浏览(945)

[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) 浏览(1016)

[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) 浏览(954)

[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) 浏览(1094)

[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) 浏览(872)

[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) 浏览(951)

[embeded] A sample of searial port communication

2019-7-10 写技术

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <termios.h> void main() { struct termios opt; int tty; int len; int i; unsigned...

阅读全文>>

标签: embedded C linux

评论(0) 浏览(1132)

Powered by anycle 湘ICP备15001973号-1