- 博客(6)
- 收藏
- 关注
原创 链表c/c++实现
单链表 `#include<stdio.h> #include #include #include<stdlib.h> using namespace std; typedef char ElemType; typedef struct LNode { ElemType data; struct LNode *next; } LNode,*LinkList; /LinkL...
2020-04-02 15:39:54
95
原创 python
python 冒泡排序 arr=input(" ") l=[int(n) for n in arr.split()] count=len(l) for i in range(0,count): for j in range (i+1,count): if l[i]>l[j]: l[i],l[j]=l[j],l[i] print(l) ...
2020-02-29 16:23:27
88
原创 c++插入排序
c++插排 #include<iostream> using namespace std; void insersort (int a[],int n) { for(int i=1;i<n;i++) { for(int j=i;j>0;j--) { if(a[j]<a[j-1]) { int k=a[j-1]; a[j-1]=a...
2020-02-07 15:23:45
139
原创 快速排序c++
快速排序 基本原理:选一个中轴数通过一趟排序把一组数分成两部分,通常选第一个数为中轴数p,先从数组的最右边(right)开始向前搜索找到<p的数然后把这个数放在left(左侧)位置上。再从数组的最左边向后搜索找到>p的数然后放在此时right的位置上。直到left和right重合,把p放在此位置,完成第一次排序。以此类推。 #include<iostream> using ...
2020-02-07 12:31:56
105
原创 杭电1008 电梯上下楼问题
杭电1008 电梯上下楼问题 Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop,...
2020-02-06 17:26:04
192
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人