单链表的建立,把a~z 26个字母插入到链表中,并且倒叙,还要打印
2018-01-25 19:47
260 查看
#include<stdio.h> #include<stdlib.h> typedef struct linklist { char ff; struct linklist *next; }Node; typedef Node* Linklist; int main() { Linklist L, new; L = (Linklist)malloc(sizeof(Node)); L->next = NULL; int i; for(i = 0; i < 26; i++) { new = (Linklist)malloc(sizeof(Node)); new->ff = 'a' + i; new->next = L->next; L->next = new; } while(L->next) { printf("%c ", L->next->ff); L = L->next; } printf("\n"); return 0; }
相关文章推荐
- C/C++ | 20-7链表,单链表的建立,把’a'–’z’26个字母插入,倒叙,打印
- 建立单链表,把’a'–’z’26个字母插入,倒叙,打印
- 单链表建立;把26个字母插入,并倒叙
- 输入一组整型元素序列,使用尾插法建立一个带有头结点的单链表。 ② 实现该线性表的遍历。 ③ 在该单链表的第i个元素前插入一个整数。 ④ 删除该单链表中的第i个元素,其值通过参数将其返回。 ⑤ 建立两个
- 单链表的建立,测长度,打印,删除,插入,逆置c++代码实例及运行结果
- 双链表的建立,测长度,打印,插入c++代码实例及运行结果
- 建立单链表并打印链表节点值
- 单链表的建立、测长、打印、删除节点、插入节点
- 单链表的建立,测长度,打印,删除,插入,逆置c++代码实例及运行结果
- 双链表的建立,测长度,打印,插入c++代码实例及运行结果
- 单链表的创建,删除,插入,翻转,打印--数组存入单链表,单链表翻转
- 单链表的建立,测长度,打印,删除,插入,逆置c++代码实例及运行结果
- 双链表的建立,测长度,打印,插入c++代码实例及运行结果
- 数据结构——单链表的创建、逆置、插入、有序表的建立、有序单链表合并等基础操作!!
- 单链表反转,单链表创建,单链表尾部插入,单链表打印
- 链表基本操作(建立、修改,插入、删除、打印)
- 单链表的建立,测长度,打印,删除,插入,逆置c++代码实例及运行结果
- 单链表的建立,测长度,打印,删除,插入,逆置c++代码实例及运行结果
- 26个字母单链表,实现插入,删除,查找操作
- 链表:检测是否有环,是否相交,删除节点,插入节点,打印节点,建立节点,节点排序,节点逆序,