Free Online Flashcard Deck

12 Discrete Structures and Algorithms Free Online FlashCards

Study 12 Discrete Structures and Algorithms with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

Why are NAND and NOR called universal gates?

Back

NAND and NOR are universal gates: either gate type alone can implement NOT, AND, and OR.

02
Front

What is an algorithm?

Back

An algorithm is a precisely specified finite procedure that transforms input into output and produces a prescribed result.

03
Front

What precondition makes binary search valid?

Back

Binary search requires a sorted array; this lets it discard half of the remaining interval after each comparison.

04
Front

When is an algorithm correct?

Back

An algorithm is correct when it produces the required output for every valid input and terminates.

05
Front

What are the three steps of a loop-invariant proof?

Back

A loop-invariant proof uses initialization, maintenance, and termination to connect a persistent statement to the desired postcondition.

06
Front

What must a recursive correctness proof establish?

Back

A recursive correctness proof verifies a base case, a recursive step using smaller inputs, and progress toward the base case.

07
Front

What are De Morgan’s laws in Boolean algebra?

Back

De Morgan’s laws state A+B‾=A‾ B‾\overline{A+B}=\overline A\,\overline B and AB‾=A‾+B‾\overline{AB}=\overline A+\overline B.

08
Front

How many rows does a complete truth table with nn inputs have?

Back

A circuit with nn input variables has 2n2^n possible input combinations, so its complete truth table has 2n2^n rows.

09
Front

What does f(n)=Θ(g(n))f(n)=\Theta(g(n)) mean?

Back

f(n)=Θ(g(n))f(n)=\Theta(g(n)) means both f(n)=O(g(n))f(n)=O(g(n)) and f(n)=Ω(g(n))f(n)=\Omega(g(n)); the functions have the same asymptotic order.

10
Front

How many bits are needed to represent NN in binary?

Back

A binary representation of the integer NN requires Θ(log⁡N)\Theta(\log N) bits, not Θ(N)\Theta(N)\\) bits.

11
Front

Simplify A+ABA+AB.

Back

The expression simplifies to AA, because A+AB=A(1+B)=AA+AB=A(1+B)=A.

12
Front

What is a sum-of-products expression?

Back

A sum-of-products expression is an OR of AND terms, such as (A∧¬B)∨(¬A∧C)(A\land\lnot B)\lor(\lnot A\land C).