Online I found some code that used the variable explored
. This variable is implemented like a dictionary: explored = {rootId}
, but it doesn't have key-value association, moreover this variabile uses the function .add(elem)
while the dict doesn't have this function. eg. explored.add(elem)
.
Which data structure is that? (I'm using python 3.6.3)
可能是一个集合,它具有方法“ add”,但是您可以简单地打印类型,例如:
print(type(explored))
It's the set
datastructure. Here's a link to it on the official docs: https://docs.python.org/3/tutorial/datastructures.html#sets
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.