DFS中如何一找到true就返回true, 其他返回false
2013-11-22 11:41
423 查看
boolean function(object, currentLocation, Termination){
if (currentLocation satisfies Terminaiton){
return true;
}
for (go through all the nextLocations){
if (unsatisfy condition) return false;
if ( function(object[], ChangedObject, nextCurrentLocation, Termination)) return true;
}
return false;
}
if (currentLocation satisfies Terminaiton){
return true;
}
for (go through all the nextLocations){
if (unsatisfy condition) return false;
if ( function(object[], ChangedObject, nextCurrentLocation, Termination)) return true;
}
return false;
}
相关文章推荐
- boost uuid
- KVM虚拟机IO处理过程(一) ----Guest VM I/O 处理过程
- 使用jstl标签报错:According to TLD or attribute directive in tag file, attribute value
- Sicily 2014 Dairy Queen
- UINavigationController定义 一定得记住了。千万别忘记了
- Build System 和Test Framework overview总结
- IOS UIView自动调整尺寸
- Request a certificate from a certificate vendor
- IOS 开发之设置UIButton的title
- UiAutoMator 测试框架
- primary key与unique的区别
- UIKit Function Reference
- 【iOS 7】使用UIScreenEdgePanGestureRecognizer实现swipe to pop效果
- Hibernate中的query.setFirstResult(),query.setMaxResults();
- 移动设备上的媒体查询 CSS media queries for mobile device
- 一大批有用的iOS 7 icon模板和UI Kit
- ERROR:the server has either erred or is incapable of performing the requested operation
- NSIS MUI 的内置向导页面
- UEditor的不能编译一些问题
- 软件版本GA,RC,alpha,beta,Build 含义