随笔分类 -  algorithm

A* pseudocode
摘要:struct node { node *parent; int x, y; float f, g, h;} // A*initialize the open listinitialize the closed listput the starting node on the open list (you can leave its f at zero)while the open list is not empty find the node with the least f on the open list, call it "q" pop q off the ... 阅读全文

posted @ 2013-07-25 16:30 fishyk

DFS ,BFS Pseudocode
摘要:// Simple dfsfunction dfs(node position) color(position) for each successor adjacent to node "position" if successor is colored, skip it if next is the goal node, stop the search else, dfs(successor) endend// Simple bfsstructure node position pos node *parentendfu... 阅读全文

posted @ 2013-07-25 14:52 fishyk

插入排序
摘要:static void Main(string[] args) { Random rand = new Random(); int[] array = { 5, 2, 4, 6, 1, 3 }; for (int i ... 阅读全文

posted @ 2013-04-07 00:04 fishyk

导航