The function found (int id) is to find an element whose id value is equal to id in the container and return this serial number to the caller.
For example:
Devil stDev
// .....
int j = sdev . findid(5); //Indicates that the ID value of the element pointed by j is 5, that is, state[j]. id == 5。
I don't know if I understand this ~