2 ms·
Quicksort isn't O(n), as far as I know, the best you can do is O(n log(n)) Implies isn't something I've ever had to program... and it took me a moment to figure
by mikewarot 6y ago
Quicksort isn't O(n), as far as I know, the best you can do is O(n log(n))
Implies isn't something I've ever had to program... and it took me a moment to figure out that NOT B implies NOT A, which is interesting... but I don't see how it's useful.
- Jtsummers 6y agoImplies is probably something you've used in a program's logic, it's probably not something you've directly programmed (in the sense that few people, outside of exercises, are going to code up logical operators). You'll see it in some conditionals. Think of the logical expression: If the radiation emitter is on then the safety door is closed. This is not causal, we don't say that we will close the door, we are saying something that should just be true about the system (like in an assert). Perhaps if this assert fails we want the whole thing to shutdown. Since languages like C don't have an implies operator, you'd write this assert as something like: ASSERT(!RADIATION_EMITTER_ON || DOOR_IS_SHUT, "Well, we irradiated something, but probably not what we wanted.") It holds the same logical meaning (you can evaluate it by examining the truth table of A => B and ~A || B). A B | A => B ~A || B F F | T T F T | T T T F | F F T T | T T