- 博客(6)
- 收藏
- 关注
原创 链式存储结构实现队列
//采用链式存储结构实现队列,包括进队、出队、队空操作#include <stdio.h>#include <iostream>#include <string.h>using namespace std;#define N 5struct Node{ int c; Node *link;};struct LinkQueue{ LinkQueue() { front = nullptr; rear = nullptr; } ~L.
2021-10-30 19:05:29 265
原创 链表实现选择排序和基数排序
#include <stdio.h>#include <math.h>int nodeNum = 5;//节点个数const int radix = 10;//进制数const int digit = 2;//最大位数struct node *creatlist();void print(struct node *head);void removeAll(struct node *head);struct node *selectSort(struct node.
2021-10-22 12:56:32 235
原创 双向循环链表的删除
建立双向循环链表,实现双向循环链表的删除操作。#include <stdio.h>int nodeNum = 5;struct node{ int t; node * llink; node * rlink;};//建表 struct node *creatlist(){ int i = 0; int t; struct node *head, *p, *q; //头结点 scanf_s("%d", &t); head = new struct
2021-10-16 21:35:37 1765
原创 删除链表中值相同的多余元素
要求:构建一个单链表,值是从小到大排序,且存在重复的值。设计算法,删除表中值相同的多余元素,使得操作后表中的所有元素值均不相同,同时释放被删除的结点空间。#include <stdio.h>int nodeNum = 5;struct node{ int t; node * link;};//建表struct node *creatlist(){ int i = 0; int t; struct node *head, ...
2021-10-16 21:34:09 758
原创 删除单链表的第i个结点
#include <stdio.h>int nodeNum = 5;struct node{ int t; node * link;};//建表 struct node *creatlist(){ int i = 0; int t; struct node *head, *p, *q; //头结点 scanf_s("%d", &t); head = new struct node; head->t = t; head->link = .
2021-10-16 21:32:08 3650
原创 基数排序(MSD、LSD)
#include <stdio.h>#include <math.h>void MSD_Sort(int s[], int left, int right, int d, int r);void LSD_Sort(int s[], int left, int right, int D, int r);int pow(int a, int b);int main(){ int i; int s1[] = { 97, 53, 88, 59, 26, 41, .
2021-10-05 16:59:03 438
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人