Skip to content

Latest commit

 

History

History
283 lines (234 loc) · 10.2 KB

abstract-data-types.md

File metadata and controls

283 lines (234 loc) · 10.2 KB

Abstract data types

Collection

  • also called: 'Sequence'
  • supports iteration (multiple times)
  • known length

List

Array

Stack

Set

Unordered set (interface)

  • usually implemented as: 'Hash table'
  • implemented in: 'std::unordered_set', 'Python set', 'Java Set'

Ordered set (interface)

  • usually implemented as: 'Binary search tree'
  • could be implemented as deterministic acyclic finite state acceptor
  • implemented in: 'std::set', 'Java SortedSet'

Multiset

Unordered multiset (interface)

  • usually implemented as: 'Hash table'
  • implemented in: 'std::unordered_multiset ', 'Python collections.Counter', 'Smalltalk Bag'

Ordered multiset (interface)

  • usually implemented as: 'Binary search tree'
  • implemented in: 'std::multiset', 'Java com.google.common.collect.TreeMultiset'

Map

  • also called: 'Associative array'
  • https://en.wikipedia.org/wiki/Associative_array
  • used to map a unique key to a value (a phone number to a name). Can only be used for exact matches. ie. cannot find all phone numbers which differ only in one digit.

Unordered map (interface)

  • usually implemented as: 'Hash table'

Ordered map (interface)

  • usually implemented as: 'Binary search tree'

Double-ended queue (deque)

Priority queue

Tree

Graph

Boolean function

Rooted graph

Simple graph

Objects which are properties of other objects

Exact cover

Maximum cut

Minimum cut

Delaunay triangulation

Voronoi diagram

  • also called: 'Voronoi tessellation', 'Voronoi decomposition', 'Voronoi partition'
  • https://en.wikipedia.org/wiki/Voronoi_diagram
  • http://mathworld.wolfram.com/VoronoiDiagram.html
  • book: 'Handbook of Discrete and Computational Geometry', 'The algorithm design manual'
  • paper: 'Nouvelles applications des paramètres continus à la théorie de formes quadratiques'
  • domain: 'Geometry'
  • found by: 'Fortune's algorithm', 'Lloyd's algorithm'
  • is dual graph of: 'Delaunay triangulation'
  • applications: 'Space partitioning', 'biological structure modelling', 'growth patterns in ecology', 'Epidemiology'
  • related: 'Closest pair of points problem', 'Largest empty sphere problem'
  • implemented in: 'scipy.spatial.Voronoi' (using Qhull), 'scipy.spatial.SphericalVoronoi'
  • based on: 'set of points in metric space'

Convex hull

  • also called: 'minimum convex polygon'
  • book: 'Handbook of Discrete and Computational Geometry', 'Introduction to Algorithms', 'The algorithm design manual'
  • https://en.wikipedia.org/wiki/Convex_hull
  • http://mathworld.wolfram.com/ConvexHull.html
  • domain: 'Computational geometry'
  • found by: 'Kirkpatrick–Seidel algorithm', 'Chan's algorithm', 'Quickhull algorithm'
  • implemented in: 'Mathematica ConvexHullMesh', 'Python scipy.spatial.ConvexHull' (using Quickhull)
  • based on: 'set of points in affine space'

Polynomial of best approximation

Lowest common ancestor

Minimum spanning tree

Spanning arborescence of minimum weight

  • also called: 'Minimum spanning arborescence', 'optimum branching problem'
  • input: 'Directed graph'
  • related problem: 'Finding spanning arborescence of minimum weight'
  • solved by: 'networkx.algorithms.tree.branchings.minimum_spanning_arborescence'

Second-best minimum spanning tree

  • book: 'Introduction to Algorithms'
  • solution need not be unique
  • variant of: 'Minimum spanning tree'

Bottleneck spanning tree

  • book: 'Introduction to Algorithms'
  • variant of: 'Minimum spanning tree'
  • a 'minimum spanning tree' is a 'bottleneck spanning tree'

Strongly connected component

Eulerian path

Gröbner basis

Eigenvalues and eigenvectors

Maximal matching

Maximum matching

Minimum maximal matching

Longest increasing subsequence

Greatest common divisor

Maximum common edge subgraph

Maximum common induced subgraph

Singular value decomposition

  • https://en.wikipedia.org/wiki/Singular_value_decomposition
  • implemented in: 'scipy.linalg.svd', 'surprise.prediction_algorithms.matrix_factorization.SVD'
  • applications: 'Matrix decomposition', 'Matrix approximation', 'Signal processing', 'Statistics'
  • used for: 'Pseudoinverse', 'Kabsch algorithm'
  • solves: 'Total least squares problem'
  • domain: 'Linear algebra'

Sparse PCA

Sparse singular value decomposition

Cholesky decomposition

  • https://en.wikipedia.org/wiki/Cholesky_decomposition
  • implemented in: 'numpy.linalg.cholesky, scipy.linalg.cholesky', 'LAPACK'
  • applications: 'Matrix decomposition', 'Matrix inversion', 'Non-linear optimization', 'Monte Carlo simulation'
  • solves: 'Linear least squares problem'
  • used for: 'Kalman filter'
  • domain: 'Linear algebra'

LU decomposition