Summary Flashcards
∃ meaning
at least one member
∀ meaning
all members
X (or Σ) meaning
the finite input alphabet/set
Y (or ω) meaning
the finite output alphabet/set
Turing machine Q symbol
set of states
Turing machine b symbol
blank symbol
Turing machine Γ symbol
set of alphabets
Turing machine Σ symbol
set of inputs
Turing machine F symbol
final state
Turing machine δ symbol
transition function
ε or Λ symbol
empty, null string
In-place sorting
When a program doesn’t require extra spaces
Not-in-place sorting
When a program requires extra spaces
In-place sorting example
Bubble sort
Not-in-place sorting example
Merge-sort
Completed graph
where every vertex is connected with an edge
Connected graph
when every vertex is connected to every other vertex
Total degree
the sum of all vertices (twice the number of edges)
In-degree
the number of edges incoming on a vertex
Out-degree
the number of edges outgoing from a vertex
Path
a sequence of vertices and edges
Circuit
a path which starts and ends at the same vertex
Cycle
a circuit that has on repeated vertices
Eulerian path
a path that visits every edge exactly once (vertex can be repeated)
Eulerian circuit
an Eulerian path that starts and ends at the same vertex
Hamiltonian path
includes every vertex exactly once
Hamiltonian circuit
a Hamiltonian path that starts and ends at the same vertex
Isomorphic graph
a graph in which a single graph can have more than one form
If a full binary tree has n internal vertices, what is the formula to calculate the total vertices?
2n + 1
If a full m-ary tree has n internal vertices, what is the formula to calculate the total vertices?
mn + 1
How to calculate the number of leaves based on a tree’s height?
If h >= 0, then t <= 2^h
Pre-order traversal
Each parent node is visited before its children
In-order traversal
Each parent node is visited in between its children
Post-order traversal
Each parent node is visited after its children
If p → q, what’s the inverse
Inverse: ~p → ~q
If p → q, what’s the converse
Converse: q → p
If p → q, what’s the contrapositive
Contrapositive: ~q → ~p