![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
有关链表
Between the steps
一步一个阶梯
展开
-
链表头插法和尾插法
文章目录1.头插法2.尾插法1.头插法#include <stdio.h>#include <stdlib.h>typedef struct LNode{int data;struct LNode *next;}LNode;//==============头插法建立链表==========================struct LNode *CreatLNode(){ int x; int LNode_len=0;原创 2021-12-21 01:03:36 · 342 阅读 · 0 评论 -
给定一个单链表,把所有的奇数节点和偶数节点分别排在一起。请注意,这里的奇数节点和偶数节点指的是节点编号的奇偶性,而不是节点的值的奇偶性。如下实例。
26.给定一个单链表,把所有的奇数节点和偶数节点分别排在一起。请注意,这里的奇数节点和偶数节点指的是节点编号的奇偶性,而不是节点的值的奇偶性。如下实例。示例 :输入: 1->2->3->4->5->NULL输出: 1->3->5->2->4->NULL#include <stdio.h>#include <stdlib.h>typedef struct LNode{ int data; str.原创 2021-12-20 22:55:29 · 918 阅读 · 0 评论 -
【无标题】
摘自子墨的博客给定一个链表,每个链表中的结点包括学号、成绩。在其中查找某个学号的学生结点,将其成绩替换成指定的新成绩#include <stdio.h>#include <stdlib.h>struct Student { int num; float score; struct Student *next;};struct List { struct Student *head; struct Student *tail;转载 2021-12-17 16:24:55 · 80 阅读 · 0 评论 -
11.28----------写一个函数建立一个有3名学生数据的单向动态链表
链表写一个函数建立一个有3名学生数据的单向动态链表. #include<stdio.h> #include<stdlib.h> #define LEN sizeof(struct Student) struct Student output(struct Student *s); struct Student{ long num; float score; struct Struct *next; };原创 2021-11-28 21:32:55 · 595 阅读 · 2 评论