数据结构之图的创建(邻接表法) 摘要:#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; #define ok 1 #define…… 文章列表 2019年04月22日 0 点赞 0 评论 874 浏览 评分:0.0
回溯法求旅行售货员问题 摘要:#include<iostream> using namespace std; const int INF = 10000000; int n, cc = 0, bestc = INF;//n表…… 文章列表 2019年04月20日 0 点赞 0 评论 1130 浏览 评分:0.0
回溯法求背包问题 摘要:#include<iostream> #define N 3 //物品总数 #define C 16//背包总质量 using namespace std; int w[N]={10,8,5}…… 文章列表 2019年04月20日 1 点赞 0 评论 744 浏览 评分:0.0
数据结构之二叉树的递归遍历和非递归遍历 摘要:一、二叉树在计算机科学中,树是一种重要的非线性数据结构,直观地看,它是数据元素(在树中称为结点)按分支关系组织起来的结构。二叉树是每个节点最多有两个子树的有序树。通常子树被称作“左子树”(left s…… 文章列表 2019年04月16日 2 点赞 0 评论 839 浏览 评分:0.0
Python3算法类多组数据输入输出格式 摘要:在 Python3 中舍弃了 Python2 中的 raw_input() 的输入方式,读入的数据全部是字符串类型,需要使用 int() 强转即可,input()读入一行数据,strip() 去除两端…… 文章列表 2019年04月15日 3 点赞 0 评论 1979 浏览 评分:9.9
c++函数模板初 摘要:#include <iostream>#include <string>using namespace std;// 你提交的代码将嵌入到这里const int SIZE = 100;template…… 文章列表 2019年04月15日 0 点赞 0 评论 936 浏览 评分:0.0
利用栈的思想写的队列 摘要: 队列是一种先进先出的线性结构。本文用栈的思想对队列重新定义,希望大家可以理解。 选取三个数据进行测试例:1 2 3 .#include<iostream> #include<cstdio> …… 文章列表 2019年04月14日 0 点赞 0 评论 799 浏览 评分:0.0
getline() 与get()两个函数的异同 摘要:#include<iostream> #include<cstdio> #include<string> #include<vector> using namespace std; cons…… 文章列表 2019年04月11日 0 点赞 0 评论 794 浏览 评分:0.0
数组与指针,能看懂的肯定是高手 摘要:#include<stdio.h> int main() { int a = 10; printf("%d\n",0[&a]); unsigned int b= &a; printf("%…… 文章列表 2019年04月08日 3 点赞 12 评论 632 浏览 评分:2.0