顺序栈和链表栈存储结构和基本操作 摘要:#includeusing namespace std; /*顺序栈*/ #define MAXSIZE 100 /*如果是顺序栈,栈顶和栈底指针也可以用int型,通过下标定位*/ type…… 文章列表 2024年05月18日 0 点赞 0 评论 195 浏览 评分:0.0
自加自减单目运算符++ --使用()无法改变优先级 摘要:C和C++中,自加++自减--都是从右向左运算。a=++i, 从右向左就是i变量的左边是++,先自增1,即(i+1)运算后给a赋值,--于此相同。a=i++, 从右向左就是i变量的左边是=,先赋值,然…… 文章列表 2024年05月18日 0 点赞 0 评论 231 浏览 评分:9.9
链表的基础操作 摘要:#include/*链表头结点内容为空*/ /*链表为顺序存取:从头指针一次按顺序找*/ typedef struct LNode { int data; struct LNode …… 文章列表 2024年05月15日 0 点赞 0 评论 168 浏览 评分:0.0
归并排序222 摘要:#include<iostream> using namespace std; int term[100]; void mergsort(int a[],int l,int r) { if…… 文章列表 2024年05月15日 0 点赞 0 评论 160 浏览 评分:0.0
快速排序111 摘要:#include<iostream>using namespace std;void qicksort(int a[],int l,int r){ if(l>=r) return; int i=l-1…… 文章列表 2024年05月15日 0 点赞 0 评论 170 浏览 评分:0.0
两个链表合成2 摘要:#include <stdio.h>typedef struct LNode{ int data; struct LNode* next;}LNode,*linkList;void initList(…… 文章列表 2024年05月15日 0 点赞 0 评论 239 浏览 评分:0.0
两个链表合并 摘要:#include <stdio.h> typedef struct LNode{ int data; struct LNode* next; }LNode,*linkList; vo…… 文章列表 2024年05月15日 0 点赞 0 评论 269 浏览 评分:0.0
线性表顺序表 摘要:#include<iostream> using namespace std; #define MAXSIZE 1000000 typedef struct { int *elem; …… 文章列表 2024年05月15日 0 点赞 0 评论 267 浏览 评分:0.0
1023[编程入门]选择排序 这两种方法哪个好? 摘要:1023 [编程入门]选择排序目前知道两种方法。一种是交换数组元素,一种是选择数组元素。本质上都是实现的数组元素交换。但是第二种方法数组元素只交换了10次。是第二种速度更快吗?第一种方法:我自己…… 文章列表 2024年05月13日 0 点赞 0 评论 237 浏览 评分:0.0
哈弗曼树的创建 摘要:#icnlude<iostream> using namespace std;//每次都从权值中重新挑选最小的两位 typedef struct { int weight;//权值 …… 文章列表 2024年05月13日 0 点赞 0 评论 269 浏览 评分:0.0