随笔分类 - c语言数据结构
c语言数据结构
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> void swap(char** a,char** b)//输入的参数是二级指针(指针的地址) { char* temp;//对指针(内容的地址)进行改变 temp= *a;//改变
阅读全文
摘要:#include<stdio.h> #include<string.h> int main() { const char *a="I love China!"; int n; scanf("%d",&n); printf("%s\n",a+n); return 0; }
阅读全文
摘要:数据结构 图的邻接矩阵表示以及深度遍历 邻接矩阵表示 定义邻接矩阵的数据结构表示 无向图的边的矩阵一定是一个对称矩阵,因为无向图只关心边是否存在,而不关心方向,V0和V1有边,那么V1和V0也有边。 找到每个点(ch)在邻接矩阵中的位置 打印邻接矩阵 深度遍历 图的深度优先搜索(Depth Firs
阅读全文
摘要:二叉树c语言的实现 二叉树的建立 二叉树的数据结构 typedef struct node{ int data; struct node* left; struct node* right; /* data */} Node; 简单创建节点 int main() { Node n1; Node n2
阅读全文

浙公网安备 33010602011771号