- 博客(6)
- 收藏
- 关注
原创 【无标题】
/************************************************************************* > File Name: iterator_iosteam.cpp > Author: 张文 > Mail: 2535796145@qq.com > Created Time: Mon 13 Dec 2021 12:27:25 PM CST > Never give up trying **************
2021-12-14 20:21:17 649
原创 【无标题】
#include<iostream> 2 #include<vector> 3 void swap(std::vector<int> &vec,int left,int right){ 4 int temp=vec[left]; 5 vec[left] = vec[right]; 6 vec[right] = temp; 7 } 8 int partion(std::vector<int> &.
2021-12-09 22:25:34 119
原创 2021-08-06
循环数组与双链表分别实现队列结构 #include<stdio.h> #include<stdlib.h> #include<malloc.h> //创建静态数组 /* #define arry_size 6 int front =1,rear = 0; static int queue[arry_size]; //使用静态数组插入先入先出,先判断是否队列满了 void insert() { int value; if( (rear+2)%arry_size !=
2021-08-06 16:56:09 50
原创 2021-07-24
数组循环移位 方法一:从结果观察数组元素的变化,数组通过三次翻转得到目标数组。 #include<stdio.h> #include<stdlib.h> void rearry(int *a,int n) //翻转a前n个元素 { int temp,i; int *ptr=a; for(i=0;i<n/2;i++) { temp =ptr[n-i-1]; ptr[n-i-1] = ptr[i]; ptr[i]=temp; } } void arry(
2021-07-24 14:44:44 203
原创 2021-07-17
单链表 #include<stdio.h> #include<stdlib.h> #include<malloc.h> //创建结构 typedef struct EX { char name[10]; int year; struct EX *link; } EX; //创建链表 EX *creatNode(int n) { int i; EX *Node,*end,*head=(EX *)malloc(sizeof(EX)); printf("请输入名
2021-07-17 12:19:07 68 2
原创 2021-07-15
链表学习记录 1.创建链表及展示 #include<stdio.h> #include<malloc.h> #include<stdlib.h> //创建结构体 typedef struct example { int x=1,y=2; //数据域 struct example *next; //指针域 }example; struct example *creat(int n) //创建链表 { example *head=(e
2021-07-15 17:02:12 51
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人