3 ms·
Often (but not always), finding a good enough addition is "almost instant", O(1) — for example, in software, how to implement a new feature, can come to you dir
by KajMagnus 6y ago
Often (but not always), finding a good enough addition is "almost instant", O(1) — for example, in software, how to implement a new feature, can come to you directly, when you read the new feature description.
But to find something to delete — then one needs to know about all existing source code — that takes O(N) to read and think about. (Unless keeps it all in memory)
Meaning, in practice, it's often O(1 * N), versus O(N * N). But yes you're right about the cases when it's a complex thing that can be done in many ways.