
其他
Cris_7
这个作者很懒,什么都没留下…
展开
-
C语言创建链表的基本操作——建立、插入、删除、清空、销毁
#include <stdio.h>#include <stdlib.h>struct node { int value; struct node * next;};typedef struct node nodes;nodes *LinkList_Init();void Insert_value(int value_in, nodes *...原创 2019-02-16 23:23:51 · 5062 阅读 · 0 评论 -
用数组实现栈结构
//用数组实现栈结构#include<iostream>#include<string>using namespace std;void push(int *stack, int num, int &index, int stack_len){ if (index >= stack_len - 1) cout &a原创 2018-09-26 10:17:02 · 362 阅读 · 0 评论 -
用数组实现队列
//用数组实现队列#include <iostream>#include <string>using namespace std;void push(int *queue, int num, int &end_index, int &queue_size, int queue_len){ if原创 2018-09-26 11:24:33 · 278 阅读 · 0 评论 -
用栈实现队列(基于数组)
#include<iostream>#include<string>using namespace std;void push(int *stack, int num, int &index, int stack_len){ if (index > stack_len - 1) cout <&am原创 2018-09-30 11:43:21 · 213 阅读 · 0 评论 -
用队列实现栈(基于数组)
#include <iostream>#include <string>using namespace std;void push(int *queue, int num, int &end_index, int &queue_size, int queue_len){ if (queue_size == queue_len) .原创 2018-09-30 11:44:17 · 154 阅读 · 0 评论 -
C++比较器的实现_函数
#include <iostream>#include <algorithm>using namespace std;struct student{ int ID; int Age; int Score;};student stu [3] = { {1, 18, 88}, {2, 19, 90}, {3, 20, ...原创 2018-10-02 21:59:39 · 3873 阅读 · 0 评论 -
C++比较器_重载运算符
#include <iostream>#include <algorithm>using namespace std;struct student{ int ID; int Age; int Score;};student stu [3] = { {1, 18, 88}, {2, 19, 90}, {3,原创 2018-10-02 22:01:48 · 960 阅读 · 0 评论 -
矩阵的“回”形打印
#include <iostream>using namespace std;void square_print(int **a, int x_temp1, int y_temp1, int x_temp2, int y_temp2){ if(x_temp1 == x_temp2) { for(int i = y_temp1; i <= y...原创 2018-10-02 22:54:03 · 483 阅读 · 0 评论 -
矩阵的90度旋转
#include <iostream>using namespace std;void shift_print(int **a, int temp1, int temp2){ //shift_square for(int i = 0; i < temp2 - temp1; i++) { int temp_s = a[temp1][t...原创 2018-10-02 22:54:47 · 325 阅读 · 0 评论 -
矩阵的“之”形打印
#include <iostream>using namespace std;void round_print(int **a, int x_temp1, int y_temp1, int x_temp2, int y_temp2, bool reverse){ if(reverse) while(x_temp1 <= x_temp2) ...原创 2018-10-03 11:58:03 · 145 阅读 · 0 评论 -
C++单向链表的创建、插入、删除、打印、销毁
#include <iostream>#include <stack>#include <string>using namespace std;struct node { int value; node *next;};//add a node at the end of the listnode *add_node(原创 2018-10-04 22:25:13 · 348 阅读 · 0 评论 -
C++链表:打印两个有序链表的公共部分
#include <iostream>#include <string>using namespace std;struct node { int value; node *next;};node *add_node(node *head, int value) { node *new_node = new node(); ne...原创 2018-10-05 16:39:38 · 472 阅读 · 0 评论 -
C++链表:判断一个链表是否为回文结构
#include <iostream>#include <string>#include <stack>using namespace std;struct node { int value; node *next;};node *add_node(node *head, int value) { node *new原创 2018-10-05 18:18:57 · 742 阅读 · 0 评论 -
C++单向链表中的荷兰国旗问题
#include <iostream>using namespace std;struct node { int value; node *next;};node *add(node *head, int value) { node *new_node = new node(); new_node -> value = value; ...原创 2018-10-14 22:46:01 · 516 阅读 · 0 评论 -
二叉树的创建和(递归)遍历
#include &lt;iostream&gt;#include &lt;stack&gt;using namespace std;struct BitNode { int value; BitNode *left; BitNode *right;};BitNode *Creat_BitNode() { BitNode *P_node; int ...原创 2019-01-09 21:51:43 · 324 阅读 · 0 评论 -
C++实现数组类
//头文件//#pragma onceclass Array_Class { private: int capcity; int size; int *Array; public: Array_Class(); Array_Class(int capcity); Array_Class(const Array_Cla...原创 2019-03-06 21:08:14 · 5251 阅读 · 0 评论 -
C++排序(6)——堆排序
#include &amp;amp;lt;iostream&amp;amp;gt;#include &amp;amp;lt;vector&amp;amp;gt;using namespace std;void swap (int &amp;amp;amp;a, int &amp;amp;amp;b){ int temp = a; a = b; b = temp;原创 2018-09-25 11:12:59 · 196 阅读 · 0 评论 -
C++排序(5)——快速排序
#include &amp;amp;lt;iostream&amp;amp;gt;#include &amp;amp;lt;vector&amp;amp;gt;#include &amp;amp;lt;ctime&amp;amp;gt;#include &amp;amp;lt;cstdlib&amp;amp;gt;using namespace std;//原创 2018-09-25 11:11:50 · 309 阅读 · 0 评论 -
C语言单向链表的反转实现
#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;typedef struct node{ int value; struct node *next;} nodes;nodes *LinkList_Init();void Insert_value(int value_in, nodes *P_node);void ...原创 2019-02-17 00:27:59 · 2667 阅读 · 0 评论 -
C语言使用同回调函数——打印不同类型的数据
#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;typedef struct node { int age; char name[20];} nodes;void Fuc_Print(void* data, int p_len, int len, void (*my_print)(void*)) { for(in...原创 2019-02-17 02:25:29 · 587 阅读 · 0 评论 -
C语言创建线性表的基本操作_建立、插入、删除、清空、销毁(操作结构体)
#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;string.h&amp;gt;typedef struct node { void **Array; int size; int capacity;}nodes;typedef struct info {原创 2019-02-17 16:36:34 · 6833 阅读 · 0 评论 -
C语言单向链表的数据结构实现——创建、插入、删除、销毁
#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;typedef struct node { int id; int age; char name[20];} nodes;typedef struct Linknode{ void* value; struct Linknode *next;}L...原创 2019-02-18 01:23:35 · 848 阅读 · 0 评论 -
C语言企业级单向链表——只维护地址域
//区别在于只维护地址域,内存释放需要用户自己来完成#include <stdio.h>#include <stdlib.h>typedef struct Linknode{ struct Linknode *next;}Linknodes;typedef struct LinkList{ Linknodes *p_head; in...原创 2019-02-18 05:16:38 · 264 阅读 · 0 评论 -
C语言栈的顺序存储结构
#include <stdio.h>#include <stdlib.h>#define MAX_SIZE 40typedef struct Stack{ void* value[MAX_SIZE]; int Size;}SeqStack;typedef struct node{ int id; int age; ch...原创 2019-02-18 18:56:31 · 351 阅读 · 0 评论 -
C语言栈的链式存储结构
#include <stdio.h>#include <stdlib.h>#define MAX_SIZE 40typedef struct Linknode{ struct Linknode *next;}LinkNodes;typedef struct Stack{ LinkNodes *Stack_Head; int Size;...原创 2019-02-18 21:05:24 · 232 阅读 · 0 评论 -
C语言队列的顺序存储结构
//头文件#pragma once#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;#include &lt;string.h&gt;typedef struct info { int id; int age; char name[20];}info_s;typedef struct AArray { ...原创 2019-02-19 03:53:53 · 376 阅读 · 0 评论 -
C语言队列的链式存储结构
#include <stdio.h>#include <stdlib.h>typedef struct LinkNode{ struct LinkNode* Next;}LinkNodes;typedef struct Mes{ LinkNodes* Use_Node; int id; int age; char na...原创 2019-02-19 20:01:48 · 402 阅读 · 0 评论 -
C语言二叉树的递归遍历、节点数目、二叉树高度、拷贝及释放
#include <stdio.h>#include <stdlib.h>typedef struct BinaryTree { int value; struct BinaryTree* Left; struct BinaryTree* Right; }BinaryTrees;void pre_trival(BinaryTrees *...原创 2019-02-26 21:47:56 · 597 阅读 · 0 评论 -
C语言二叉树的非递归遍历
#include <iostream>#include <stack>using namespace std;/* 1、将根节点 压入栈中 2、只要 栈size> 0 执行循环 2.1 拿出栈顶元素 2.2 如果栈顶元素的标志位 真 直接输出 执行下一次循环 2.3 如果不是真 该flag的标志位真 2.4 将 右子节点 和 ...原创 2019-02-26 23:14:04 · 947 阅读 · 0 评论 -
C++排序(1)——冒泡排序
#include &amp;amp;lt;iostream&amp;amp;gt;#include &amp;amp;lt;vector&amp;amp;gt;using namespace std;//冒泡排序//算法时间复杂度 O(n*n)//额外空间复杂度 O(1)void Bubble_Sort(vector &amp;amp;lt;int&amp;amp;gt; &a原创 2018-09-25 11:03:57 · 215 阅读 · 0 评论 -
C++排序(2)——选择排序
#include &amp;lt;iostream&amp;gt;#include &amp;lt;vector&amp;gt;using namespace std;//选择排序//算法时间复杂度 O(n*n)//额外空间复杂度 O(1)void Selection_Sort(vector &amp;lt;int&amp;gt; &amp;amp;num_s){原创 2018-09-25 11:08:51 · 163 阅读 · 0 评论 -
C++排序(3)——插入排序
#include &amp;amp;lt;iostream&amp;amp;gt;#include &amp;amp;lt;vector&amp;amp;gt;using namespace std;//插入排序//算法时间复杂度 log(n*n)//额外空间复杂度 O(1)void Insert_Sort(vector &amp;amp;lt;int&amp;amp;gt; &原创 2018-09-25 11:09:34 · 159 阅读 · 0 评论 -
C++排序(4)——归并排序
#include &lt;iostream&gt;#include &lt;vector&gt;using namespace std;//归并排序//算法时间复杂度 O(N*logN)//算法额外空间复杂度 O(N)void Merge(vector &lt;int&gt; &amp;num_s, int left, int mid, int right){原创 2018-09-25 11:10:21 · 167 阅读 · 0 评论 -
C#中使用DrawString绘制文本对齐方式
C#中使用DrawString绘制文本时的对齐方式C#代码:void 绘制文字(Graphics 画家){ StringFormat 格式 = new StringFormat(); 格式.Alignment = StringAlignment.Center; //居中 格式.Alignment = StringAlignment.Far; //右对齐 strin...原创 2018-05-14 16:54:52 · 7879 阅读 · 0 评论