Top "Logic" questions

Logic refers to the ultimate flow of your code and how you arrive your desired solution.

Median of 5 sorted arrays

I am trying to find the solution for median of 5 sorted arrays. This was an interview questions. The solution I …

arrays algorithm logic
How to solve && operands to logical scalar

After I run the code in matlab, I encounter this error and unsure how to solve it. How can I …

matlab if-statement logic logical-operators operands
Jasmine expect logic (expect A OR B)

I need to set the test to succeed if one of the two expectations is met: expect(mySpy.mostRecentCall.args[0]).…

javascript unit-testing logic jasmine
Conditional OR in makefile

I'd like to enable a verbose compilation in my makefile, but I can't figure out how to make a conditional …

makefile logic conditional verbose
XOR Objective-c

Is there a way to put a condition that return true only if one of the two component return true? …

iphone objective-c logic
General rules for simplifying SQL statements

I'm looking for some "inference rules" (similar to set operation rules or logic rules) which I can use to reduce …

sql logic complexity-theory reduction
Dynamically evaluating simple boolean logic in Python

I've got some dynamically-generated boolean logic expressions, like: (A or B) and (C or D) A or (A and B) …

python tree logic boolean boolean-logic
What are the best uses of Logic Programming?

By Logic Programming I mean the a sub-paradigm of declarative programming languages. Don't confuse this question with "What problems can …

functional-programming prolog logic logic-programming
Booleans have two possible values. Are there types that have three possible values?

Possible Duplicate: What's the best way to implement an 'enum' in Python? I’m writing a function that, ideally, I’…

python logic boolean
Find max sum of elements in an array ( with twist)

Given a array with +ve and -ve integer , find the maximum sum such that you are not allowed to skip 2 …

algorithm logic kadanes-algorithm