自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(30)
  • 收藏
  • 关注

原创 内部类介绍

内部类

2023-02-01 12:55:07 57

原创 单例模式.

单例模式

2023-01-17 12:24:35 64

原创 代码块的语法和用法

代码块的语法和用法

2023-01-14 17:16:29 203

原创 static用法

static用法

2023-01-12 20:18:25 65

原创 java实现汉诺塔

java实现汉诺塔

2023-01-07 11:43:20 114

原创 数据结构:循环队列

循环队列

2022-07-19 20:02:15 94

原创 数据结构:链队列

链队列

2022-06-30 14:44:12 91

原创 数据结构之栈

2022-06-25 16:10:25 88

原创 数据结构之单链表

简单的单链表

2022-06-23 21:01:13 96

原创 N皇后问题

前言——n皇后问题N 皇后问题源自国际象棋,所有棋子中权力最大的称为皇后,它可以直着走、横着走、斜着走(沿 45 度角),可以攻击移动途中遇到的任何棋子。N 皇后问题的具体内容是:如何将 N 个皇后摆放在 N*N 的棋盘中,使它们无法相互攻击。#include <stdio.h>#include <malloc.h>#include <math.h>/*** Place it there, applicable?*/bool place(int...

2022-05-29 20:49:46 43

原创 数据结构:哈夫曼树

在计算机数据处理中,哈夫曼编码使用变长编码表对源符号(如文件中的一个字母)进行编码,其中变长编码表是通过一种评估来源符号出现机率的方法得到的,出现机率高的字母使用较短的编码,反之出现机率低的则使用较长的编码,这便使编码之后的字符串的平均长度、期望值降低,从而达到无损压缩数据的目的。#include <stdio.h>#include <stdlib.h>#include <string.h>typedef double DataType; //结点权..

2022-05-29 20:47:42 120

原创 数据结构:二叉树

#include <stdio.h>#include <malloc.h>#define QUEUE_SIZE 5typedef struct BTNode{ char element; BTNode* left; BTNode* right;}BTNode, * BTNodePtr;typedef struct BTNodePtrQueue{ BTNodePtr* nodePtrs; int front;...

2022-05-24 16:52:03 40

原创 压缩矩阵和转置

压缩矩阵、压缩矩阵的转置压缩矩阵实际上就是将一个二维矩阵的非零元素单独记录并存储与之对应的行和列。压缩矩阵的转置:就是将压缩矩阵的行和列交换就可以了,实际的操作就是将转置前的每一列的非零元素记录下来,然后再计算对应的转置后的压缩矩阵每一行对应的首元素的首个相对地址,然后将转置前的第i列赋值给转置后的第i行。注意的是如果转置后的某一行已经赋值了一个元素那么该行的首个元素的相对地址就要加一。#include <stdio.h>#include <malloc.h&gt

2022-05-19 21:04:17 281

原创 矩阵的乘法

二维数组、二维数组的乘法二维数组在概念上是二维的,具有行和列,但在内存中是连续存放的;换句话说,二维数组的各个元素是相互挨着的,彼此之间没有缝隙。在本代码测试静态二维数组的地址时就可以清晰的知道。例如Array[m][n]表示的就是有一个m行n列的二维数组。二维数组乘法的满足条件:第一个数组的列必须等于第二个数组的行。得到的新二维数组的行等于第一个二维数组的行,列等于第二个二维数组的列。相乘公式:#include <stdio.h>#include <malloc.h&

2022-05-19 20:56:33 184

原创 数据结构:循环队列

professor's code:#include <stdio.h>#include <malloc.h>#define TOTAL_SPACE 5/*** Circle int queue.*/typedef struct CircleIntQueue{ int data[TOTAL_SPACE]; int head; int tail;}*CircleIntQueuePtr;/*** Initialize the q...

2022-05-17 20:09:14 74

原创 数据结构:链队列

professor's code:#include <stdio.h>#include <malloc.h>/*** 链队列的节点.*/typedef struct LinkNode{ int data; LinkNode* next;}*LinkNodePtr;/*** 链队列.*/typedef struct LinkQueue{ LinkNodePtr front; LinkNodePtr rear;}*Li...

2022-05-17 19:58:15 170

原创 递归实现汉诺塔

#include<stdio.h>intHanoi(intNumber,charstartColumn,charpassColumn,charendColumn){if(Number==1){printf("从%c柱移动到%c柱子\n",startColumn,endColumn);return0;}else{Hanoi(Number-1,startColumn,endColumn,...

2022-05-12 21:27:41 100

原创 递归累加求和

professor's code:#include <stdio.h>/*** Recursive addition.*/int addTo(int paraN) { int tempSum; printf("entering addTo(%d)\r\n", paraN); if (paraN <= 0) { printf(" return 0\r\n"); return 0; } else { ...

2022-05-12 21:16:51 99

原创 数据结构8.表达式求值

liu's code://202031061018 刘知鑫#include <iostream>#include <cstring>#include <algorithm>#include <stack>#include <unordered_map>using namespace std;stack<int> num;stack<char> op;void eval(){ auto b..

2022-05-10 20:25:17 324

原创 数据结构7.括号匹配

professor‘s code:#include <stdio.h>#include <malloc.h>#define STACK_MAX_SIZE 10/*** Linear stack of integers. The key is data.*/typedef struct CharStack { int top; int data[STACK_MAX_SIZE]; //The maximum length is fixed.} ...

2022-05-09 21:53:42 65

原创 数据结构3.双向链表

professor's code:#include <stdio.h>#include <malloc.h>/*** Double linked list of integers. The key is char.*/typedef struct DoubleLinkedNode{ char data; struct DoubleLinkedNode *previous; struct DoubleLinkedNode *next;} D...

2022-05-09 20:01:07 143

原创 数据结构6.栈

professor's code:#include <stdio.h>#include <malloc.h>#define STACK_MAX_SIZE 10/*** Linear stack of integers. The key is data.*/typedef struct CharStack { int top; int data[STACK_MAX_SIZE]; //The maximum length is fixed.} ...

2022-05-09 19:55:43 263

原创 数据结构5.多项式的相加

professor's code:#include <stdio.h>#include <malloc.h>/*** Linked list of integers. The key is data. The key is sorted in non-descending order.*/typedef struct LinkNode{ int coefficient; int exponent; struct LinkNode *next...

2022-05-05 22:25:44 80

原创 数据结构4.静态链表

professor's code:#include <stdio.h>#include <malloc.h>#define DEFAULT_SIZE 5typedef struct StaticLinkedNode{ char data; int next;} *NodePtr;typedef struct StaticLinkedList{ NodePtr nodes; int* used;} *ListPtr;/**...

2022-05-03 20:25:30 406

原创 数据结构2.单链表

professer's code:#include <stdio.h>#include <malloc.h>/*** Linked list of characters. The key is data.*/typedef struct LinkNode{ char data; struct LinkNode *next;} LNode, *LinkList, *NodePtr;/*** Initialize the list with ...

2022-04-29 21:23:50 778

原创 数据结构1.顺序表

老师代码#include <stdio.h>#include <malloc.h>#define LIST_MAX_LENGTH 10/*** Linear list of integers. The key is data.*/typedef struct SequentialList { int actualLength; int data[LIST_MAX_LENGTH]; //The maximum length is fixed....

2022-04-25 21:00:55 571 1

原创 位操作符

&按位与运算规则,只有都为1才是1,其余为03&5011101得到 001即1| 按位或运算规则,有1就得1,无1就得0011101得到111即7^按位异或运算规则,相同就得0,不同就得1011101得到 110 即6...

2021-09-27 21:36:24 46

原创 /ddd和/xdd

\ddd:d是八进制的数字\ddd的功能是把该八进制数字转换为10进制,再输出该10进制数对应的ASCII码值的字符。如\132132转换为十进制等于18^2+38+2=90,在ASCII表中对应Zprintf("%c",’\132’)得到Z\xdd:d是16进制数同理printf(“%c”,\x61)得到6*16+1=97对应的a...

2021-09-27 21:20:15 719

原创 字符型数组

字符型数组#include<stdio.h>int main(){char arr1[ ]=“abc”;char arr2[ ]={‘a’,‘b’,‘c’};printf("%s",arr1); //打印字符串用的是%sprintf("%s",arr2);return 0;}打印后的结果arr1输出abc,arr2输出a,b,c,…随后为乱码在arr1内c隐藏了一个\0,而arr2内c后是随机的,\0表示停止,所以ar...

2021-09-27 19:58:42 176

原创 定义的标识符常量和枚举常量

定义的标识符常量和枚举常量定义的标识符常量:#define max 10定义了值为10的常量maxint are [max]={0}的写法是正确的枚举常量:enum sex{Male,Female,Secret} ;int main(){enum sex s=Male/Female/secret//对应的值分别为0,1,2,且不可被改变,因为其为常量;但s的值是可变的,因为其为变量。return 0;}...

2021-09-27 19:05:52 149

WDlauncher.exe

WDlauncher.exe

2022-12-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除