Next privilege 1,000 Rep.
See votes, expandable usercard
Next badge 0/1
~19k people reached
- 0 posts edited
- 0 helpful flags
- 1 vote cast
Big O Nested For Loop Breakdown
This will always remain O(n) since this algorithm will always scale linear. There is no logarithmic increase or decrease to be found. Obviously with higher N's this will take longer, but it will be a linear scaling always.
Liskov substitution and abstract classes / strategy pattern
As far as the example goes, it is not in violation of the LSP, I've updated my answer to reflect that.
What is the best practice, point of view of well experienced developers
I agree, there might be reasons, there actually almost always are. I've however found that focusing on 99% of the cases avoids discussion on a sound principle revolving around a very specific case that doesn't happen very often, if at all.