3 ms·
The search order is neither indeterministic, nor deterministic; it is undefined. Some implementations do depth-first search, others go random. If your code is
by bux93 2y ago
The search order is neither indeterministic, nor deterministic; it is undefined. Some implementations do depth-first search, others go random.
If your code is logically correct, it doesn't matter in the end - except if you use the cut-operator which essentially says 'don't look any further, just go with the first match', which will behave (in)deterministically based on the implementation.