Easy way to check if item is in list?
Posted
by befall
on Stack Overflow
See other posts from Stack Overflow
or by befall
Published on 2010-04-20T04:42:14Z
Indexed on
2010/04/20
4:43 UTC
Read the original article
Hit count: 336
Hey guys,
I'm writing a search algorithm in C++, and one of the things I need to do is have a few if statements that check cells above, below, left of, and right of.
Each time a cell is found to be open and added to the stack, I want it added to a list of cells already checked.
I want to be able to say in the if loop if(thisCell is not in checkedCells)
.
Any simple ideas?
Thanks!
© Stack Overflow or respective owner