
算法
牟林伟
我们都要好好的!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
简单算法--递归
李白打酒话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。 逢店加一倍,遇花喝一斗。 这一路上,他一共遇到店5次,遇到花10次,已知最后一次遇到的是花,他正好把酒喝光了。 请你计算李白遇到店和花的次序,可以把遇店记为a,遇花记为b。则:babaabbabbabbbb 就...原创 2018-11-06 21:07:54 · 145 阅读 · 0 评论 -
A*寻路C++ 代码
#include "AStar.h"//准备一张 开标 和 闭表std::vector<CAStar::_NODE>CAStar::open;std::vector<CAStar::_NODE>CAStar::close;#define _ABS(v) ((v) < 0 ? -(v):(v))#define _H_V(c, e) (_ABS...原创 2018-12-19 18:14:15 · 531 阅读 · 0 评论 -
A*寻路
#include <algorithm>#include <iostream>#include <vector>#include <math.h>int W;int H;int S;struct Position{ Position(int _x = 0,int _y = 0) { x = _x; y = _y; ...原创 2018-12-19 18:32:07 · 248 阅读 · 1 评论 -
一些小方法诸如:交换值,排序,查找等等
#include<iostream>#include<windows.h>//#include"c:\Users\Administrator\Desktop\dd\aaa.h"//------strlen 没有结束符,sizeof 有结束符int a = 1;int b = 2;int arr[] ={1,2,6,4,8,9,11,55,23};int mu...原创 2018-12-19 19:00:10 · 252 阅读 · 0 评论