数据结构与算法
chinaunixj
这个作者很懒,什么都没留下…
展开
-
04hashtab-hashtab
list.hstruct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struct l转载 2012-11-14 14:44:36 · 556 阅读 · 0 评论 -
08btree
btree/btree.c#include #include "btree.h"static void bnode_init(struct btree_info *info, struct bnode_info *bnode){ bnode->parent = NULL; bnode->lchild = NULL; bnode转载 2012-11-14 17:15:19 · 540 阅读 · 0 评论 -
04hashtab-josephus
list.h struct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struc转载 2012-11-14 14:49:52 · 466 阅读 · 0 评论 -
05list-hlist
list.h struct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struc转载 2012-11-14 15:05:00 · 533 阅读 · 0 评论 -
container_of
#include struct foo { size_t a; size_t b; char c;};#define offsetof(type, member) \ ((size_t)(&((type*)0)->member))#define container_of(ptr, type, member) \转载 2012-11-14 15:06:29 · 489 阅读 · 0 评论 -
06mkfile-01tst
Makefileabc = helloSRCS = func_a.c func_b.c main.c list $(abc)abc ?= testSRCS += worldA := charB := $(A)#all: $(SRCS)#$(SRCS): aaa bbb# @echo $@# @echo $^#转载 2012-11-14 15:10:08 · 507 阅读 · 0 评论 -
06mkfile-03tree
include/func_a.hvoid func_a(); include/func_b.hvoid func_b); lib/func_a.c#include #include "func_a.h"void func_a(){ printf("%s\n", __FUNCTION__);}lib/func_b.c#includ转载 2012-11-14 15:21:10 · 581 阅读 · 0 评论 -
09btree
09btree/btree.c#include #include "btree.h"#include "queue.h"static void bnode_init(struct btree_info *info, struct bnode_info *bnode){ bnode->parent = NULL; bnode->lchil转载 2012-11-15 14:44:04 · 566 阅读 · 0 评论 -
11sort
list.hstruct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struct l转载 2012-11-16 09:27:31 · 616 阅读 · 0 评论 -
10calc
calc/calc.h#include "stack.h"enum pre_flag { OPR, NUM,};typedef ssize_t num_t;struct calc_info { const char *expr; char *cur; struct stack_info opr; struc转载 2012-11-16 09:22:47 · 602 阅读 · 0 评论 -
12sort
list.hstruct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struct l转载 2012-11-16 09:42:59 · 546 阅读 · 0 评论 -
huff
list.hstruct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struct l转载 2012-11-16 10:09:01 · 662 阅读 · 0 评论 -
07mkfile
include/func_a.hvoid func_a(); include/func_b.hvoid func_b(); lib/func_a.c#include #include "func_a.h"void func_a(){ printf("%s\n", __FUNCTION__);}lib/func_b.c #in转载 2012-11-14 15:28:11 · 606 阅读 · 0 评论 -
06mkfile-02singledir
func_a.c#include #include "func_a.h"void func_a(){ printf("%s\n", __FUNCTION__);}func_b.c#include #include "func_b.h"void func_b(){ printf("%s\n", __FUNCTION__);}转载 2012-11-14 15:14:19 · 553 阅读 · 0 评论 -
单链表逆序详解
单链表逆序详解FWD from :http://blog.sina.com.cn/s/blog_71319eae0100tlz7.html 1、具有链表头的单链表一段单链表逆序的程序 typedef struct student{ int number; char name[20]; int score; struct student转载 2012-03-14 14:11:23 · 615 阅读 · 0 评论 -
单链表的建立、插入、删除
////////////////////////////////////////////单链表的初始化、建立、插入、查找、删除//////////////////////////////////////////#include #include typedef int ElemType;//定义结点类型typedef struct Node{转载 2012-03-14 17:19:27 · 809 阅读 · 0 评论 -
架构离不开数据结构
内容来自:http://www.jdon.com/jivejdon/thread/41928A说:没有人跟帖吗?那我先谈谈我的观点吧,学计算机的人都学过数据结构这门课,教材的开始就谈到了一个公式:软件= 数据结构+算法,大家似乎认为计算软件发展到现在这个公式已经跟不上时代了,其实则不然,这个公式依旧是一条定理,就算是面向对象编程的下一代编程思想出现,这个公式仍然是正确的转载 2012-03-16 09:48:52 · 732 阅读 · 1 评论 -
Linux Kernel中list解读
作者:Sam (甄峰) sam_code@hotmail.com Sam之前看2.4kernel时,常看到List.也仔细看了一下,但现在长期没有看kernel,没有写程序,已经忘记了很多。今天又看一看并记录下来。 LinuxKernel中,常常需要使用双向链表。在~/include/linux/list.h中,就定义了双向链表和常用的function. 链表头如下:s转载 2012-04-18 14:06:17 · 458 阅读 · 0 评论 -
单链表
slist.h typedef int elem_t;struct node_info { elem_t data; struct node_info *next;};struct list_info { struct node_info head; void (*add)(struct list_原创 2012-11-13 09:14:12 · 539 阅读 · 0 评论 -
单链表(有头)
#include #include typedef int elem_t;struct node_info { elem_t data; struct node_info *next;};static void init_head(struct node_info *head){ head->data = 0转载 2012-11-13 09:19:05 · 534 阅读 · 1 评论 -
单链表无头
#include typedef int elem_t;struct node_info { elem_t data; struct node_info *next;};static void list_add(struct node_info **head, struct node_info *no转载 2012-11-13 09:23:12 · 444 阅读 · 0 评论 -
02dlist-priv
list.hstruct node_info { struct node_info *prev; struct node_info *next; char priv[];};struct list_info { struct node_info *head; void (*add)(struct list_info *,转载 2012-11-13 14:10:32 · 447 阅读 · 0 评论 -
03dlist-stack
list.hstruct node_info { struct node_info *prev; struct node_info *next; char priv[];};struct list_info { struct node_info *head; void (*add)(struct list_info *,转载 2012-11-13 16:45:35 · 452 阅读 · 0 评论 -
02dlist-base
list.htypedef int elem_t;struct node_info { elem_t data; struct node_info *prev; struct node_info *next;};struct list_info { struct node_info *head; void (*add)(stru转载 2012-11-13 14:05:45 · 557 阅读 · 0 评论 -
03dlist-kernel_list
list.h struct list_head { struct list_head *prev; struct list_head *next;};#define LIST_HEAD(head) struct list_head head = {&head, &head}static inline void INIT_LIST_HEAD(struc转载 2012-11-13 16:38:00 · 463 阅读 · 0 评论 -
云计算 Instagram 5位传奇工程师背后的"极简"技术(PPT全译)
http://www.csdn.net/article/2013-03-28/2814698-The-technologie-%20behind-Instagram转载 2013-03-29 14:43:08 · 815 阅读 · 0 评论