Lotuscc
Lotuscc
全部文章
分类
C/C++语言基本算法(34)
C专家编程(1)
C和C指针(2)
Shell编程(8)
读书笔记(1)
随笔(9)
题解(9)
归档
标签
去牛客网
登录
/
注册
Lotuscc的博客
你和你的犬色声马,我和我的各安天涯。 千里走单骑,八方为敌。 青灯古佛度苍生,不愿度己。
全部文章
(共64篇)
二分查找,递归实现
二分查找,递归实现 #include<stdio.h> int a[10] = {0,1,2,3,4,5,6,7,8,9}; //head为查找的起始位置,Size为查找区间的大小,num为查找的值 int find(int *head, int Size, int num);...
2018-10-13
0
438
数组形式最小堆的建立以及排序
最小堆 利用数组建立堆之前,需要知道一些理论知识。 利用数组储存时,从1开始,如果一个结点的下标为i, 那么他的左儿子的下标为2i, 他的右儿子的下标为2i+1. 如果一个结点的下标为j 那么它的父结点的下标为 j/2 特别主意,要从a【1】开始储存。 #include <std...
2018-10-10
0
665
利用递归选数
已知 n 个整数 x1x2…xn,以及一个整数 k(k<n)。从 n 个整数中任选 k 个整数相加,可分别得到一系列的和。例如当 n=4,k=3,4 个整数分别为 3,7,12,19 时,可得全部的组合与它们的和为: 3+7+12=22 3+7+19=29 7+12+19=38 3+12+19...
2018-07-17
0
416
Dijkstra算法求最短路径
以下是上面图以v0为起点的算法详细过程 1.标记V0 -- true[1]=1 初始化 Len[]={ 0 , INF , 10, INF , 30 , 100} 这里数组首元素未用到,数组下标从1开始表示V0以此类推 2.第一次循环与V0相邻的有V2、V4、V5,其中V2距离最短...
2018-06-22
0
450
二进制文件的一些基本操作
#include<stdio.h> typedef struct stuent Stu; struct stuent { char name[20]; int age; }; Stu S[100]; void InPut(int N); //写入文...
2018-06-13
0
349
归并排序
#include <stdio.h> #include<stdlib.h> typedef int ElementType; void MSort(ElementType A[],ElementType TmpArry[],int Left,int Right); void...
2018-06-11
0
426
离散数学实验
//真值运算 #include<stdio.h> int main() { int p,q; char t='y'; while(t) { printf("是否运算程序(y/n):\n"); scanf("%c",...
2018-06-11
0
421
堆排序
#include <stdio.h> #define LeftChild(i) (2 * (i) + 1) typedef int ElementType; void PercDown(ElementType A[],int i,int N); void HeapSort(El...
2018-06-10
0
689
希尔排序及其基本操作
#include <stdio.h> typedef int ElementType; //自定义类型 void ShellSort(ElementType A[],int N); //希尔排序 void ShellSort_N(ElementType ...
2018-06-10
0
509
插入排序
#include <stdio.h> typedef int ElementType; void InsertionSort(ElementType X[],int N); //插入排序 int main(void) { int i; int b[20] =...
2018-06-10
0
350
首页
上一页
1
2
3
4
5
6
7
下一页
末页