
算法专栏
SoloLinux
专注Kernel,GPU Driver,ROCM,CPU, Power/Performance开
展开
-
算法复杂性和如何计算时间复杂度
一,定义算法的复杂性有时间复杂性和空间复杂性之分这里考虑的是时间复杂性通常考虑3种情况下的时间复杂性:最坏,最好和平均情况下的计算复杂性;当然可操作性最好且最有实际价值的是最坏情况下的时间复杂性T(n)=max(t(i)) 设i是算法A的一个输入,p(i)是出现输入i的概率,算法A对于输入i的计算时间耗费为t(i)首先了解一下几个概念。一个是时间复杂度,一个是渐近时间复杂度。前者是某个算法的时间耗费,它是该算法所求解问题规模n的函数,而后者是指当问题规模趋向无穷大时,该算法时间复杂度的数量级。当转载 2020-10-20 00:40:38 · 1528 阅读 · 0 评论 -
Matrix Graph Sample Code
// MGraph.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <stdlib.h>#include <stdio.h>const int MaxVertexNum = 100;typedef int WeightType;...原创 2019-11-05 16:36:10 · 302 阅读 · 0 评论 -
二叉搜索树的demo code
树的建立树节点的查询:最大,最小,某个节点值树节点的删除// Binary_Search_Tree.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <stdlib.h>#include <stdio.h>typedef i...原创 2019-11-04 17:04:11 · 167 阅读 · 0 评论 -
数据结构-队列学习
#include <stdio.h>#include <stdlib.h>#include <stdfix.h>typedef int ElementType;typedef int Position;typedef struct QNode{ ElementType *Data; Position front,rear; ...原创 2019-10-31 19:44:02 · 191 阅读 · 0 评论 -
最常用的数据结构预算法:
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。本文链接:https://blog.youkuaiyun.com/ityqing/article/details/82838524数据结构指的是“一组数据的存储结构”,算法指的是“操作数据的一组方法”。数据结构是为算法服务的,算法是要作用再特定的数据结构上的。最常用的数据结构预算法:数据结构:数组...转载 2019-09-13 23:18:58 · 775 阅读 · 0 评论 -
堆栈Stack的数组实现方法
//// Created by Perry Yuan on 2019/9/26.//#include <stdio.h>#include <stdlib.h>#include <time.h>#include <stdbool.h>#define MaxSize 200typedef int ElementType ;typ...原创 2019-09-27 00:30:55 · 312 阅读 · 0 评论 -
二叉搜索树的插入删除操作
二插搜索树的插入删除操作node find(node BiTree,ELEMENT_TYPE X )//迭代 的方式查找最大元素节点,右子树最后面的节点就是最大值,同理左子树最小值为最左侧的节点node find_Max1(node Bitree)node find_Min(node Bitree)//尾递归 的方式查找最大元素节点node find_Max(node Bitree...原创 2019-10-09 12:26:02 · 285 阅读 · 0 评论