您的位置:首页 > 编程语言 > Go语言

backtracking in Date Structures and Algorithm Analysis in C

2015-01-26 19:52 447 查看

# turnpike reconstruction problem

reconstruct a point set from the distances
This algorithn generally:O(N^2*logN)  but take exponential time in the worst case.
 
If there is no back tracking, the runningtime is O(N^2*logN)
 
but if backtracking happens, theperformance is affected.
 
 


# eight queens

find a placement of 8 queens on a 8*8chessboard such that no two queens are in the same row,column,diagonal,orantidiagonal of the chessboard
 
constrains:
Si = {1,2,3,4,5,6,7,8} for 2<=i<=8
xi != xj if i != j
(xi - xj)/(i-j) != 1 or -1
 
n! candidates in the solution space
 
also using backtracking with a decisiontree
 
 
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐