UCLan, CO2412 (2021/22): Glossary

Adjacency list

Adjacency lists are one of the data structures that can be used to implement graphs. An adjacency list for a vertex (node) contains pointers (or references) to the adjacent vertices, i.e., to the nodes to which it is connected by an edge.

See also: Adjacency matrix, Graph, Incidence list

Adjacency matrix

Adjacency matrices are a data structure that is preferably used to implement dense graphs, i.e., graphs with comparably many edges per node. An adjacency matrix is a two-dimensional data structure, such as a list of lists or a two-dimensional array.

See also: Adjacency list, Graph, Incidence list

Balanced tree

In binary search trees, being balanced is a property that ensures that the depth of the tree scales with O(log n). This guarantees that the overall shape of the data structure remains tree-like rather than, e.g., degenerating into the sequential shape of a sorted linked list.

The property of being balanced is not restricted to binary search trees; it can in principle be applied to trees in general.

See also: Binary search tree, Tree

Binary search tree

A search tree is a tree that is inherently sorted, making it easy to search for an element or to insert a new element. A binary tree is a tree in which each node has at most two links (outgoing edges) to at most two children. These two branches or subtrees are often called called left and right; in a binary search tree, each node stores a data item (e.g., called item) such that:

See also: Balanced tree, Tree

Traversal is the process of visiting all the elements of a data structure. Breadth-first search (BFS) is one of the standard algorithms for traversing a graph; starting from a given initial node, it continues by always proceeding to the node that was detected earliest.

See also: Depth-first search, Graph, Queue

Brute force

As an algorithm design strategy, brute force consists in evaluating each potential solution to the problem, until the right one is found; or, in the case of an optimization problem, until all potential solutions have been visited so that the best one is known.

See also: Divide and conquer, Dynamic programming, Greedy algorithms

Depth-first search (DFS) is one of the standard algorithms for traversing a graph; starting from a given initial node, it continues by always proceeding to the node that was detected most recently.

Using a stack as an iterator, this traversal algorithm in last-in, first-out (LIFO) order can be implemented by iteratively carrying out the following steps:

  1. Visit the present node.
  2. Detect all nodes that are unvisited so far and can be reached directly from the present node; push (i.e., attach) them to the top of the stack.
  3. Pop (i.e., detach) nodes from the top of the stack until an unvisited node is found - proceed there.

For many purposes it may be easier to implement DFS using recursion (internally implemented via a stack of function calls) instead of using a stack data structure to store detected nodes. A graph consisting only of edges used for visiting nodes during DFS is called a DFS spanning tree (or depth-first tree).

See also: Breadth-first search, Graph, Stack

Divide and conquer

Divide and conquer is an algorithm design strategy, specifically, a decomposition technique. The overall problem is recursively decomposed into smaller and smaller subproblems (divide), until a base case with a trivial solution is reached (conquer), and then the partial solutions to the subproblems are combined with each other in order to obtain the complete solution.

See also: Brute force, Dynamic programming, Greedy algorithms

Dynamic programming

Dynamic programming is an algorithm design strategy, specifically, a decomposition technique. It can be used whenever the problem can best be decomposed into overlapping subproblems, i.e., smaller versions of the problem among which it is beneficial computationally to reuse or share partial solutions (rather than recompute them). Dynamic programming stores partial solutions in an appropriate data structure, so that they can be recalled and reused when they are needed again.

See also: Brute force, Divide and conquer, Greedy algorithms

Exponentiation

Exponentiation is the "power of" operation. A term in which exponentiation is used, such as bk, consists of the base b and the exponent k.

Graph

A graph is a structure consisting of vertices (also called nodes) and edges; it is in use both as a data structure and as a theoretical/mathematical concept. A vertex is understood to be point-like; an edge is a connection between two vertices.

See also: Adjacency list, Adjacency matrix, Breadth-first search, Depth-first search, Incidence matrix, Tree

Greedy algorithms

As a design strategy, greedy algorithms develop a single candidate solution from the beginning to the end, making incremental local improvements step by step, until the task is finished and the complete solution is returned.

See also: Brute force, Divide and conquer, Dynamic programming

Incidence list

Incidence lists are one of the data structures that can be used to implement graphs. In a graph, two nodes (vertices) are incident to each edge, and in a directed graph, one of these nodes is the source of the edge whereas the other one is its target. Similar as for adjacency lists, an incidence list belongs to a node of the graph: It is a list of edges to which that node is incident.

See also: Adjacency list, Adjacency matrix, Graph

Leading contribution

In asymptotic performance, efficiency, and complexity analysis using Landau notation, the amount of time and space (memory) resources required as a function of the problem size n is reduced to the leading contribution, i.e., the one that dominates all the others for large values of n.

Permutations

Permutations are the ways in which the elements of a list can be arranged, resulting in lists with the same elements, but in all possible orders. For a list with n elements, there are n · n-1 · … · 2 · 1 = n! permutations.

Queue

A queue is a sequential (list-like) dynamic data structure that functions by the principle first in, first out (FIFO). It has a method for appending an element, usually called push and done at the tail of the queue, and a method for detaching an element, usually called pop and done at the head of the queue.

See also: Breadth-first search, Stack

Stack

A stack is a sequential (list-like) dynamic data structure that functions by the principle last in, first out (LIFO). It has a method for appending an element, usually called push and done at the head of the stack, and a method for detaching an element, usually called pop and also done at the head of the stack.

See also: Depth-first search, Queue

Tree

A tree is a hierarchical linked data structure, where each node has outgoing links to a number of children, i.e., nodes at the next lower level; at the highest level of a tree (the level with depth 0), there is exactly one node which is called the root.

See also: Balanced tree, Binary search tree, Graph

Index