n個(gè)石頭(每相鄰兩個(gè)的距離是1米,最邊上石頭和岸的距離也是1米),禮物放在第m個(gè)石頭上,青蛙第i次跳2*i-1米.問能否得到禮物.(n>=49肯定能得到禮物,n<49,可以bfs或遞歸)
上傳時(shí)間: 2013-12-30
上傳用戶:linlin
java的DFS(Depth-first search )和bfs(Breadth-first search)的實(shí)現(xiàn)
標(biāo)簽: search Breadth-first Depth-first java
上傳時(shí)間: 2015-02-13
上傳用戶:skhlm
數(shù)據(jù)結(jié)構(gòu)里的bfs算法,用vc6.0編寫
標(biāo)簽: bfs 數(shù)據(jù)結(jié)構(gòu) 算法
上傳時(shí)間: 2013-12-17
上傳用戶:tianyi223
bfs、DFS、有向圖、無向圖中的各種算法的實(shí)現(xiàn),可以自動(dòng)生成圖形。
上傳時(shí)間: 2013-11-27
上傳用戶:qwe1234
數(shù)據(jù)結(jié)構(gòu)中關(guān)于DFS和bfs的練習(xí),較簡單的實(shí)現(xiàn)了二叉樹的DFS和bfs搜索
標(biāo)簽: DFS bfs 數(shù)據(jù)結(jié)構(gòu)
上傳時(shí)間: 2015-04-24
上傳用戶:Pzj
利用bfs算法解八數(shù)碼問題 在3*3的方格上放著1-8數(shù)碼,有一空格為0變化規(guī)則為空格可以和上,下,右,左四個(gè)相鄰的數(shù)字互換, 至到和目標(biāo)狀態(tài)相等, 每一種狀態(tài)用一個(gè)結(jié)點(diǎn)表示 而每個(gè)結(jié)點(diǎn)每次變化最多有四種結(jié)點(diǎn),將這些結(jié)點(diǎn)依次入隊(duì)列中, 例如初始結(jié)點(diǎn)S0,入隊(duì)列后出隊(duì),將S0變化最多產(chǎn)生的四種結(jié)點(diǎn)S01,S02,S03,S04依次入隊(duì)列中, 當(dāng)S01出隊(duì)后,產(chǎn)生的四種結(jié)點(diǎn)S11,S12,S13,S14(實(shí)際上不會(huì)有四種結(jié)點(diǎn))依次入隊(duì), 每次出隊(duì)時(shí)與結(jié)束結(jié)點(diǎn)相比較,如果相等則退出, 為了,防止已經(jīng)入隊(duì)的結(jié)點(diǎn)再次入隊(duì),(這樣會(huì)造成列循環(huán)),將每次入隊(duì)的結(jié)點(diǎn)設(shè)置一個(gè)標(biāo)識(shí)號, 四種變化即:向上,向下,向右,向左,我們要求向上和向下互斥,向右和向左互斥
上傳時(shí)間: 2015-04-24
上傳用戶:sdq_123
Implemented bfs, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
標(biāo)簽: Implemented following compile command
上傳時(shí)間: 2014-01-01
上傳用戶:lhc9102
這是一個(gè)基于bfs文件搜索的java代碼
上傳時(shí)間: 2014-12-05
上傳用戶:xfbs821
zoj 1136題。 bfs搜索+同余求解
上傳時(shí)間: 2016-01-10
上傳用戶:shizhanincc
兩種AstarPathFinder 一種DijkstraPathfinder bfs,DFS等相關(guān)尋路代碼總結(jié) 帶地圖隨機(jī)生成和記時(shí)器
標(biāo)簽: DijkstraPathfinder AstarPathFinder bfs
上傳時(shí)間: 2014-01-03
上傳用戶:天誠24
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1