文章分类 - 算法
摘要:前两天用到了插入排序法,为了以后使用方便,今天做个笔记伪代码:1 insertion_sort(array)2 for j 0 and array[i] > key6 do array[i+1] = 0 && *(array+j) > key)11 {12 *(array+j+1) = *(array+j);13 j--;14 }15 *(array+1) = key;16 }17 }
阅读全文
摘要:FindWay.h 1 #ifndef __FINDWAY_H__ 2 #define __FINDWAY_H__ 3 4 #include "global.h" 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std;11 12 class LLK_Vector 13 {14 public:15 int x;16 int y;17 LLK_Vector();18 LLK_Vector(int _x, int _y);19 bool operator==...
阅读全文
摘要:之前做unity3d游戏时用到的a*寻路算法,整理出来记录一下 1 public struct MyVector 2 { 3 public int x; 4 public int y; 5 public MyVector( int _x, int _y ) 6 { 7 x = _x; 8 y = _y; 9 } 10 }; 11 12 public class Point 13 { 14 public MyVector position; 15 public int h; 16 public int g; 17 pub...
阅读全文

浙公网安备 33010602011771号