I am a teacher!

导航

2019年7月10日 #

BFS(五):八数码难题 (POJ 1077)

摘要: Eight Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 阅读全文

posted @ 2019-07-10 11:13 aTeacher 阅读(825) 评论(0) 推荐(0)

BFS(四):搜索状态判重

摘要: 在采用广度优先算法进行搜索时,一个需要重点注意的是在搜索过程中判重和去重。前面介绍的几个例子中,判重都较简单,如采用vis[]数组,若vis[i]==0,则i未访问过,i入队列;若vis[i]!=0,则i已访问过,不再重复访问。 但在有些实际应用中,判重不是简单一个设置就可完成的。例如,给出一个由1 阅读全文

posted @ 2019-07-10 10:47 aTeacher 阅读(614) 评论(0) 推荐(0)