链表常见的种排序.docVIP

  • 3
  • 0
  • 约5.91万字
  • 约 7页
  • 2016-12-25 发布于河南
  • 举报
#pragma once struct list_head { struct list_head *prev; struct list_head *next; }; #define LIST_HEAD_INIT(head) \ struct list_head (head) = {(head), (head)} /*内联函数: 函数调用时,直接把函数体中的代码拷贝到调用位置 特点: 执行效率高,不发生传递和返回 普通函数: 发生函数调用时,会在内存中查找以该函数名,命名的区域然后发生传递执行和返回的过程 内联函数的规则: 1. 适用于函数提比较简洁,逻辑比较简单的函数 2. 不能是递归函数 3. 不能使用函数指针指向该函数 4. 不支持除if以外的逻辑控制结构 5. inline 一般会配合static,控制作用域,防止函数名冲突 */ static inline void list_head_init(struct list_head *node) { node-next = node; node-prev = node; } static inline void __list_add(struct list_head *node, struct list_head *Prev, struct list_head *Next) { node-n

文档评论(0)

1亿VIP精品文档

相关文档