0% found this document useful (0 votes)
74 views3 pages

CS350 HW6: Algorithm Glossary

This document defines key terms related to algorithms, data structures, graphs, and rooted trees. It provides concise definitions for terms like algorithms, complexity classes P and NP, data structures like stacks and queues, graph concepts like paths and trees, and rooted tree terminology such as leaves, roots, and parents.

Uploaded by

Ashwin Krish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views3 pages

CS350 HW6: Algorithm Glossary

This document defines key terms related to algorithms, data structures, graphs, and rooted trees. It provides concise definitions for terms like algorithms, complexity classes P and NP, data structures like stacks and queues, graph concepts like paths and trees, and rooted tree terminology such as leaves, roots, and parents.

Uploaded by

Ashwin Krish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

lOMoARcPSD|7981319

FIT1045 – Glossary - AK

Algorithms
Algorithm An algorithm is a sequence of unambiguous instructions for solving
a problem, i.e., for obtaining a required output for any legitimate input
in a finite amount of time.
Big-O Notation A function f (n) is in O(g(n)) (read “f is in big oh of g”) if
there are positive numbers c and n0 such that for all n ≥ n0 it holds that
t(n) ≤ cg(n).
Combinatorial optimisation problem Given a collection of objects, a fea-
sibility constraint and a cost function, the problem of finding a feasible
combination of objects of optimal cost among all feasible combinations of
objects.
Computational complexity The (best-case/worst-case) computational (time)
complexity of an algorithm is the number of elementary steps T (n) needed
for computing its output for an input of a size n (in the best/worst case).
Decision Problem A computational problem is called a decision problem if
the required output for each input is Boolean (yes or no). Inputs for which
output is yes (True) are a called yes-input. Inputs for which output is no
(False) are a called no-input.

NP, complexity class The class NP is the class of decision problems D that
have certificates which can be verified in polynomial time.
NP-complete A decision problem D is NP-complete if it is in NP and all
problems in NP are polynomially reducible to D.

P, complexity class The class P is the class of decision problems that can be
solved by a polynomial time algorithm.
Polynomial time An algorithm is called polynomial time if its worst-case time
complexity T (n) is in O(p(n)) for some polynomial p (i.e., p(n) = n,
p(n) = n2 , p(n) = n3 , etc.).

Polynomially reducible A decision problem D1 is polynomially reducible to


a decision problem D2 if there is a function t that transforms inputs of D1

1
lOMoARcPSD|7981319

to inputs of D2 such that t is computable by a polynomial time algorithm


and maps yes-inputs of D1 to yes-inputs of D2 and no-inputs of D1 to
no-inputs of D2 .

Data Structures
Binary Search Tree A binary search tree is a binary tree where all vertices
are labelled and have the following property: for each vertex v with label
k the labels of all vertices in the left subtree of v are less or equal to k and
the labels of all vertices in the right subtree of v or greater or equal to k.
Heap A (min) heap is a binary tree where all vertices are labelled and has
the following two properties 1. The tree is essentially complete, i.e., only
some right-most vertices on the last level can be missing. 2. The tree is
partially ordered, i.e., for each vertex v with label k, the labels of each of
its children are greater or equal to k.
Queue A queue is a linear data structure in which elements are added only to
the back (enqueue) and removed only from the front (dequeue).
Stack A stack is a linear data structure in which elements are added (push)
and removed (pop) only from the back.
Table A table is a data structure that organises a set of values along the two
dimensions of rows and columns.

Graphs
Clique A clique is a subset of vertices C of a graph such that for every two
distinct vertices v, w from C there is an edge between v and w (cf. inde-
pendent set).
Connected A graph is called connected if it contains a path between any two
of its vertices.
Cycle A cycle is a path P = [v1 , . . . , vk ] in a graph such that v1 = vk .
Independent Set An independent set is a subset of vertices C of a graph such
that for every two distinct vertices v, w from C there is no edge between
v and w (cf. clique).
Hamiltonian Cycle A Hamiltonian Cycle of a graph is a cycle that contains
all vertices of that graph.
Path A path is a non-self-intersecting sequence P = [v1 , . . . , vk ] of successively
connected vertices in a graph G = (V, E). More formally for all i from 1
to k − 1 we have that (vi , vi+1 ) is in E, and for all i, j with 1 ≤ i < j ≤ k
we have that if vi = vj then i = 1 and j = k (that means a vertex is only

Downloaded by Ashwin Krishna (akri0017@[Link])


lOMoARcPSD|7981319

allowed to show up twice in the path if it is the start and end vertex, in
which case we refer to the path as a cycle).
Path Length The length of a path P = [v1 , . . . , vk ] in an edge-weighted graph
G = (V, E, w) is the sum of all edge weights along the path, i.e., w(v1 , v2 )+
. . . + w(vk−1 , vk ). In an unweighted graph the length P is simply the
number of contained edges k − 1, which is the same as assuming that all
edge weights are equal to 1.
Spanning Tree A spanning tree of a graph G = (V, E) is a subgraph T =
(V, F ) of G that contains all vertices of G and that is a tree.

Simple A graph is called simple if it does not contain loops or parallel edges.
In this unit we usually assume graphs to be simple unless we explicitly
mention otherwise.
Tree A tree is a graph that is connected and acyclic (does not contain any
cycles).
Vertex Cover A vertex cover is a subset of vertices C of a graph such that for
every edge of the graph either of the two end points is in C.

Rooted Trees
Binary Tree A binary tree is a rooted tree where each vertex has at most two
children, a left child and a right child.
Child In a tree with root r, a vertex v is called the child of another vertex p if
p is the predecessor of v on the unique path from v to the root r.

Height The height of a rooted tree is the maximum length of a path from the
root to a leaf (or −1 if the tree is empty).
Inner Vertex A vertex in a rooted tree is called an inner vertex if it has at
least one child.

Leaf A vertex in a rooted tree is called a leaf it it does not have any children.
Parent The parent of a vertex v in a tree with root r is the predecessor of v
on the unique path from v to the root r (the root itself does not have a
parent).

Perfect A binary tree is called perfect if all of its inner vertices have exactly
two children and all leafs are on the same level.

You might also like