
参看:
A*算法
Floyd算法
迪杰斯特拉算法
博文:
http://www.cnblogs.com/dolphin0520/archive/2011/08/27/2155542.html
http://blog.csdn.net/karldoenitz/article/details/8350277
http://bbs.csdn.net/topics/260084619

自从有了柚子美衣,再也不担心出门木有衣衣换了。
淘宝皇冠卖家,火爆了!件件条条清爽又白搭,好看又便宜 ,再不下手应该悔恨流涕了!
点击查看更多
作者: shuang
|
发表于:2014年7月30日
|
栏目:推广
|
妞,白雪衣衣萝卜价,没有它我们真的很忧伤……已关闭评论
阅读全文

鲜花小熊巧克力–带上她赴浪漫七夕之约,给心爱的你特别的爱。同城鲜花礼盒,惊喜到家!
作者: shuang
|
发表于:2014年7月30日
|
栏目:推广
|
浪漫七夕之约,一招搞定亲爱的她已关闭评论
阅读全文

如果ID是主键或者有索引,可以直接查找:
方法一:
查询上一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误):
select * from table_a where id = (select id from table_a where id < {$id} [and other_conditions] order by id desc limit 1) [and other_conditions];
查询下一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误):
select * from table_a where id = (select id from table_a where id > {$id} [and other_conditions] order by id a......
作者: owoer
|
发表于:2014年7月29日
|
栏目:MySQL
|
MySQL查询当前数据上一条和下一条的记录已关闭评论
阅读全文

mysql版
SELECT 2 * 6378.137 * ASIN( SQRT( POW( SIN( PI( ) * ( 114.09576416015625 - 114.1798 ) /360 ) , 2 ) + COS( PI( ) * 114.09576416015625 /180 ) * COS( 114.1798 * PI( ) /180 ) * POW( SIN( PI( ) * ( 22.3932534047735 - 114.1798 ) /360 ) , 2 ) ) ) AS a
FROM dual
php版
function rad($d)
{
return $d * 3.1415926535898 / 180.0;
}
function GetDistance($lat1, $lng1, $lat2, $lng2)
{
$EARTH_RADIUS = 6378.137; //公里
$radLat1 = rad($lat1);
$radLat2 = rad($lat2);
$a = $radLat1 – $ra......