- 博客(4)
- 收藏
- 关注
原创 最大公约数
最大公约数的算法及其证明# include <stdio.h>int GCD(int A,int B){ while (B != 0) { int remainder = A % B; //A对B取余,若A<B,则余数为B; A = B; //B作为被除数 B = remainder ; //余数作为除数 } return A;}int main(){ int a,b; scanf("%d %d", &a, &b);
2021-06-18 13:33:50 130
翻译 单链表
单链表建立一个单链表遍历链表计算链表的长度插入一个节点删除节点对链表进行排序#include <stdio.h>#include <malloc.h>#include <stdlib.h>typedef struct Node{ int data; //数据区 struct Node * pNext; //指针区}NODE, * PNODE;PNODE create_list(void); //建立一个链表void t
2021-06-11 18:04:03 106
原创 单链表的删除
链表的删除源代码片段typedef struct Node{ int data;//数据域 struct Node *pNext;//指针域}NODE, *PNODE;//NODE == sturct Node PNODE == struct Node *//删除第pos个节点的后一个节点bool delete——list(PNODE pHead, int pos, int * pVal){ int i = 0; PNODE p = pHead; while (NULL
2020-05-14 19:46:47 259
转载 源码
#include<stdio.h>#include<malloc.h>#include<stdlib.h>typedef struct Node{ int data;//val position struct Node *pNext;//zhi zhen yv}NODE, *PNODE;//NODE == sturct Node PNODE == struct Node *//han shu definePNODE create_l
2020-05-14 19:44:07 342
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人