2 ms·
> Also, could it be that both methods fail terribly (infinite loops?) when they are given wrong input such as elements not in the list at all? You could just s
by MauranKilom 6y ago
> Also, could it be that both methods fail terribly (infinite loops?) when they are given wrong input such as elements not in the list at all?
You could just say "has undefined behavior unless target is an element of the list".
Whatever your choice though - this is slide code. It should be obvious that it's not production ready.