プリンキピア

第3章データ構造とアルゴリズム

Chapter Review章の復習

Key Terms重要用語

abstract data type (ADT)
抽象データ型(ADT)
consists of all data structures that share common functionality
共通の機能を持つすべてのデータ構造からなるもの
abstraction
抽象化
process of simplifying a concept in order to represent it in a computer
ある概念をコンピューター内で表現するために、単純化する過程
adjacent
隣接
in a graph abstract data type, the relationship between two vertices connected by an edge
グラフ抽象データ型において、辺で結ばれた2頂点の関係
algorithm analysis
アルゴリズム解析
study of the results produced by the outputs as well as how the algorithm produces those outputs
出力によって得られる結果と、その出力をアルゴリズムがどのように生み出すかを研究すること
algorithm design pattern
アルゴリズムの設計パターン
solution to well-known computing problems
よく知られた計算上の問題に対する解法
algorithmic paradigm
アルゴリズムのパラダイム
common concept and ideas behind algorithm design patterns
アルゴリズムの設計パターンの背後にある共通の概念や考え方
algorithmic problem solving
アルゴリズムによる問題解決
refers to a particular set of approaches and methods for designing algorithms that draws on computing’s historical connections to the study of mathematical problem solving
計算と数学的な問題解決の研究との歴史的なつながりを土台とする、アルゴリズム設計のための特定の考え方や方法の集まり
array list
配列リスト
data structure that stores elements next to each other in memory
メモリ内で要素を隣り合わせに保存するデータ構造
asymptotic analysis
漸近解析
evaluates the time that an algorithm takes to produce a result as the size of the input increases
入力サイズが増えるにつれ、アルゴリズムが結果を生み出すのにかかる時間を評価すること
asymptotic notation
漸近記法
mathematical notation that formally defines the order of growth
増加のオーダーを形式的に定義する数学記法
AVL tree
AVL木
balanced binary search tree data structure often used to implement sets or maps that organizes elements according to the AVL tree property
AVL木の性質に従って要素を整理する平衡二分探索木のデータ構造。集合やマップの実装によく使われる
AVL tree property
AVL木の性質
requires the left and right subtrees to be balanced at every node in the tree
木のすべてのノードで、左右の部分木が平衡していることを求める性質
balanced binary search tree
平衡二分探索木
introduces additional properties that ensure that the tree will never enter a worst-case situation by reorganizing elements to maintain balance
要素を組み替えて平衡を維持する追加の性質を導入し、木が最悪の状況に陥らないようにするもの
Big O notation
ビッグO記法
most common type of asymptotic notation in computer science used to measure worst case complexity
最悪時の計算量を測るため、コンピューターサイエンスで最もよく使われる漸近記法
binary heap
二分ヒープ
binary tree data structure used to implement priority queues that organizes elements according to the heap property
ヒープの性質に従って要素を整理する二分木のデータ構造。優先度付きキューの実装に使われる
binary logarithm
2を底とする対数
tells how many times a large number needs to be divided by 2 until it reaches 1
大きな数を2で何回割ると1になるかを示すもの
binary search algorithm
二分探索アルゴリズム
recursively narrows down the possible locations for the target in the sorted list
整列したリスト内で、目的の要素が存在し得る位置を再帰的に絞り込むもの
binary search tree
二分探索木
tree data structure often used to implement sets and maps that organizes elements according to the binary tree property and the search tree property
二分木の性質と探索木の性質に従って要素を整理する、木のデータ構造。集合やマップの実装によく使われる
binary tree property
二分木の性質
requires that each node can have either zero, one, or two children
各ノードの子が0個、1個、2個のいずれかであることを求める性質
breadth-first search
幅優先探索
iteratively explores each neighbor, expanding the search level-by-level breadth-first
隣接する各頂点を反復的に調べ、レベルごとに横へ探索を広げること
brute-force algorithm
総当たりアルゴリズム
solves combinatorial problems by systematically enumerating all potential solutions in order to identify the best candidate solution
すべての可能な解を体系的に列挙し、最良の解候補を特定して、組合せ問題を解くもの
canonical algorithm
標準的なアルゴリズム
well-known algorithm
よく知られたアルゴリズム
case analysis
場合分けによる解析
way to account for variation in runtime based on factors other than the size of the problem
問題のサイズ以外の要因に基づいて、実行時間のばらつきを扱う方法
child node
子ノード
descendant of another node
別のノードの子孫
collision
衝突
situation where multiple objects hash to the same integer index value
複数のオブジェクトが、同じ整数のインデックス値にハッシュされる状況
combinatorial explosion
組合せ爆発
exponential number of solutions to a combinatorial problem that makes brute-force algorithms unusable in practice
組合せ問題の解が指数関数的な数となり、総当たりアルゴリズムを実際には使えなくすること
combinatorial problem
組合せ問題
involves identifying the best candidate solution out of a space of many potential solutions
多くの可能な解の空間から、最良の解候補を見つける問題
comparison sorting
比較による整列
sorting of a list of elements where elements are not assigned numeric values but rather defined in relation to other elements
要素に数値を割り当てず、ほかの要素との関係で定義したリストを整列すること
complexity
計算量
condition based on the degree of computational resources that an algorithm consumes during its execution in relation to the size of the input
入力サイズとの関係で、アルゴリズムが実行中に消費する計算資源の量に基づく性質
compression
圧縮
problem of representing information using less data storage
より少ないデータ記憶領域で情報を表す問題
constant
定数
type of order of growth that does not take more resources as the size of the problem increases
問題のサイズが増えても、必要な資源が増えない増加のオーダー
correctness
正しさ
whether the outputs produced by an algorithm match the expected or desired results across the range of possible inputs
あり得る入力の範囲全体で、アルゴリズムの出力が、期待される結果や望ましい結果と一致するかどうか
cost model
コストモデル
characterization of runtime in terms of more abstract operations such as the number of repetitions
繰り返し回数など、より抽象的な操作で実行時間を表したもの
count sorting
計数ソート
sorting a list of elements by organizing elements into categories and rearranging the categories into a logical order
要素を分類ごとに整理し、分類を論理的な順序に並べ替えることで、要素のリストを整列すること
cryptography
暗号
problem of masking or obfuscating text to make it unintelligible
テキストを隠したり難読化したりして、理解できなくする問題
data structure
データ構造
complex data type with specific representation and specific functionality
具体的な表現方法と具体的な機能を持つ、複雑なデータ型
data structure problem
データ構造の問題
computational problem involving the storage and retrieval of elements for implementing abstract data types such as lists, sets, maps, and priority queues
リスト、集合、マップ、優先度付きキューなどの抽象データ型を実装するために、要素の保存や取得を扱う計算上の問題
data type
データ型
determines how computers process data by defining the possible values for data and the possible functionality or operations on that data
データが取り得る値と、可能な機能や操作を定め、コンピューターによるデータの処理方法を決めるもの
depth-first search
深さ優先探索
graph traversal algorithm that recursively explores each neighbor, continuing as far possible along each subproblem depth-first
隣接する各頂点を再帰的に調べ、各部分問題で可能な限り奥へ進むグラフ走査アルゴリズム
Dijkstra’s algorithm
ダイクストラ法
maintains a priority queue of vertices in the graph ordered by distance from the start and repeatedly selects the next shortest path to an unconnected part of the graph
開始点からの距離で並べたグラフの頂点の優先度付きキューを維持し、未接続の部分へ向かう次の最短経路を繰り返し選ぶもの
divide and conquer algorithm
分割統治アルゴリズム
algorithmic paradigm that breaks down a problem into smaller subproblems (divide), recursively solves each subproblem (conquer), and then combines the result of each subproblem in order to inform the overall solution
問題を小さい部分問題へ分け(分割)、各部分問題を再帰的に解き(統治)、それぞれの結果を組み合わせて全体の解に反映する、アルゴリズムの考え方
edge
辺
relationship between vertices or nodes
頂点やノードの間の関係
element
要素
individual data point
個々のデータ点
experimental analysis
実験による分析
evaluates an algorithm’s runtime by recording how long it takes to run a program implementation of it
アルゴリズムを実装したプログラムの実行にかかる時間を記録して、実行時間を評価する方法
functionality
機能
operations such as adding, retrieving, and removing elements
要素の追加、取得、削除などの操作
graph
グラフ
represents binary relations among collection of entities, specifically vertices and edges
実体の集まりの間にある二項関係を、具体的には頂点と辺で表すもの
graph problem
グラフの問題
computational problem involving graphs that represent relationships between data
データ間の関係を表すグラフに関わる、計算上の問題
greedy algorithm
貪欲アルゴリズム
solves combinatorial problems by repeatedly applying a simple rule to select the next element to include in the solution
単純な規則を繰り返し適用し、次に解へ含める要素を選んで、組合せ問題を解くもの
hash table
ハッシュテーブル
implements sets and maps by applying the concept of hashing
ハッシュの考え方を適用して、集合やマップを実装するもの
hashing
ハッシュ法
problem of assigning a meaningful integer index for each object
各オブジェクトに意味のある整数のインデックスを割り当てる問題
heap property
ヒープの性質
requires that the priority value of each node in the heap is greater than or equal to the priority values of its children
ヒープの各ノードの優先度の値が、その子の優先度の値以上であることを求める性質
heapsort algorithm
ヒープソートアルゴリズム
adds all elements to a binary heap priority queue data structure using the comparison operation to determine priority value and returns the sorted list by repeatedly removing from the priority queue element-by-element
比較操作で優先度を決めながら、すべての要素を二分ヒープの優先度付きキューへ追加し、その後、要素を1つずつ繰り返し取り出して、整列したリストを返すもの
index
インデックス
position or address for an element in a list
リスト内の要素の位置またはアドレス
interval scheduling problem
区間スケジューリング問題
combinatorial problem involving a list of scheduled tasks with the goal of finding the largest non-overlapping set of tasks that can be completed
予定された作業のリストを扱い、時間が重ならず実行できる作業の集合のうち、最大のものを見つけることを目標とする組合せ問題
intractable
扱いにくい問題
problems that do not have efficient, polynomial-time algorithms
効率的な多項式時間アルゴリズムのない問題
Kruskal’s algorithm
クラスカル法
greedy algorithm that sorts the list of edges in the graph by weight
グラフの辺のリストを重みで整列する貪欲アルゴリズム
leaf node
葉ノード
node at the bottom of a tree that has no children
木の最下部にあり、子を持たないノード
linear
線形
type of order of growth where the resources required to run the algorithm increases at about the same rate as the size of the problem increases
アルゴリズムの実行に必要な資源が、問題のサイズとほぼ同じ割合で増える、増加のオーダー
linear data structure
線形データ構造
category of data structures where elements are ordered in a line
要素を一列に並べるデータ構造の種類
linked list
連結リスト
data structure that does not necessarily store elements next to each other and instead works by maintaining, for each element, a link to the next element in the list
要素を必ずしも隣り合わせに保存せず、各要素に、リスト内の次の要素へのリンクを保持して動作するデータ構造
list
リスト
ordered sequence of elements and allows adding, retrieving, and removing elements from any position in the list
要素の順序付きの列。任意の位置で要素を追加、取得、削除できる
logarithm
対数
tells how many times a large number needs to be divided by a small number until it reaches 1
大きな数を小さな数で何回割ると1になるかを示すもの
longest path
最長経路
problem of finding the highest-cost way to get from one vertex to another without repeating vertices
頂点を繰り返し訪れずに、一方の頂点から別の頂点へ最大コストで移動する方法を見つける問題
map
マップ
represents unordered associations between key-value pairs of elements, where each key can only appear once in the map
キーと値の組の、順序のない対応関係を表すもの。各キーはマップ内に1回しか現れない
matching
照合
problem of searching for a text pattern within a document
文書内でテキストのパターンを探す問題
merge sort
マージソート
canonical divide and conquer algorithm for comparison sorting
比較による整列の、標準的な分割統治アルゴリズム
minimum spanning tree
最小全域木
problem of finding a lowest-cost way to connect all the vertices to each other
すべての頂点を互いに接続する、最小コストの方法を見つける問題
model of computation
計算モデル
rules of the underlying computer that is ultimately responsible for executing the algorithm
最終的にアルゴリズムの実行を担うコンピューターの、根本的な規則
node
ノード
represents an element in a tree or graph
木やグラフの要素を表すもの
nondeterministic algorithm
非決定性アルゴリズム
special kind of Turing machine, which at each step can non-deterministically choose which instruction to execute and is considered to successfully find a solution if any combination of these nondeterministic choices leads to a correct solution
各ステップで実行する命令を非決定的に選べる、特殊なチューリングマシン。その選択の何らかの組合せが正しい解に至れば、解の発見に成功したとみなされる
nondeterministic polynomial (NP) time complexity class
非決定性多項式(NP)時間計算量クラス
all problems that can be solved in polynomial time by a nondeterministic algorithm
非決定性アルゴリズムによって、多項式時間で解けるすべての問題
NP-complete
NP完全
all the hardest NP problems—the combinatorial problems for which we do not have deterministic polynomial-time algorithms
NPの中で最も難しいすべての問題。決定性多項式時間アルゴリズムのない組合せ問題
order of growth
増加のオーダー
geometric prediction of an algorithm’s time or space complexity as a function of the size of the problem
問題のサイズの関数として、アルゴリズムの時間計算量や空間計算量を幾何学的に予測したもの
perfectly balanced
完全に平衡した
for every node in the binary search tree, its left and right subtrees contain the same number of elements
二分探索木のすべてのノードについて、左右の部分木が同じ要素数を持つこと
polynomial (P) time complexity class
多項式(P)時間計算量クラス
all problems that have runtimes described with a polynomial expression such as O(1), O(log N), O(N), O(N log N), O(N2), O(N3)
O(1)、O(log N)、O(N)、O(N log N)、O(N2)、O(N3)などの多項式の式で表される実行時間を持つ、すべての問題
Prim’s algorithm
プリム法
greedy algorithm that maintains a priority queue of vertices in the graph ordered by connecting edge weight
接続する辺の重み順に並べた、グラフの頂点の優先度付きキューを維持する貪欲アルゴリズム
priority queue
優先度付きキュー
represents a collection of elements where each element has an associated priority value
各要素に優先度の値を対応させた、要素の集まりを表すもの
problem
問題
task with specific input data and output data corresponding to each input
具体的な入力データと、それぞれの入力に対応する出力データを持つ課題
problem model
問題モデル
simplified, abstract representation of a more complex real-world problem
より複雑な現実世界の問題を、単純化し抽象的に表したもの
program
プログラム
realization or implementation of an algorithm written in a formal programming language
形式的なプログラミング言語で書いた、アルゴリズムの実現または実装
quicksort algorithm
クイックソートアルゴリズム
recursively sorts data by applying the binary search tree algorithm design pattern to partition data around pivot elements
二分探索木の設計パターンを適用し、ピボット要素を基準にデータを分割して、再帰的に整列するもの
reachable vertex
到達可能な頂点
vertex that can be reached if a path or sequence of edges from the start vertex exists
開始頂点からの経路、すなわち辺の列が存在し、たどり着ける頂点
reduction algorithm
帰着アルゴリズム
solves problems by transforming them into other problems
問題をほかの問題へ変換して解くもの
representation
表現
particular way of organizing a collection of elements
要素の集まりを整理する具体的な方法
root node
根ノード
node at the top of the tree
木の最上部のノード
runtime analysis
実行時間解析
study of how much time it takes to run an algorithm
アルゴリズムの実行にかかる時間を研究すること
search tree property
探索木の性質
requires that elements in the tree are organized least-to-greatest from left-to-right
木の要素が左から右へ小さい順に並ぶことを求める性質
searching
探索
problem of retrieving a target element from a collection of elements
要素の集まりから目的の要素を取得する問題
sequential search algorithm
逐次探索アルゴリズム
searching algorithm that sequentially checks the collection element-by-element for the target
要素の集まりを1要素ずつ順に確認し、目的の要素を探すアルゴリズム
set
集合
represents an unordered collection of unique elements and allows adding, retrieving, and removing elements from the set
重複しない要素を順序なしで集めたもの。要素の追加、取得、削除ができる
shortest path
最短経路
problem of finding a lowest-cost way to get from one vertex to another
一方の頂点から別の頂点へ移動する、最小コストの方法を見つける問題
shortest paths tree
最短経路木
output of the shortest paths problem, the lowest-cost way to get from one vertex to every other reachable vertex in a graph
最短経路問題の出力。グラフのある頂点から、ほかのすべての到達可能な頂点へ最小コストで到達する方法
sorting
整列
problem of rearranging elements into a logical order
要素を論理的な順序に並べ替える問題
space complexity
空間計算量
formal measure of how much memory an algorithm requires during its execution as it relates to the size of the problem
問題のサイズとの関係で、アルゴリズムが実行中に必要とするメモリ量を表す形式的な尺度
step
ステップ
basic operation in the computer, such as looking up a single value, adding two values, or comparing two values
単一の値の参照、2値の加算、2値の比較などの、コンピューターの基本操作
string problem
文字列の問題
computational problem involving text or information represented as a sequence of characters
文字の列として表されたテキストや情報に関わる、計算上の問題
subproblem
部分問題
smaller instance of a problem that can be solved independently
独立して解ける、ある問題の小さい事例
time complexity
時間計算量
formal measure of how much time an algorithm requires during execution as it relates to the size of the problem
問題のサイズとの関係で、アルゴリズムの実行に必要な時間を表す形式的な尺度
tractable
扱いやすい問題
problems that computers can solve in a reasonable amount of time
コンピューターで妥当な時間内に解ける問題
traveling salesperson problem (TSP)
巡回セールスマン問題(TSP)
problem of, given the path cost of every pair of vertices, finding the lowest-cost tour, or path from a start vertex visiting every vertex in the graph once including a return to the start vertex
すべての頂点の組の経路コストが与えられたとき、開始頂点から出発し、すべての頂点を1回ずつ訪れて開始点へ戻る、最小コストの巡回路を見つける問題
traversal
走査
problem of exploring all the vertices in a graph
グラフのすべての頂点を調べる問題
tree
木
hierarchical data structure
階層的なデータ構造
Turing machine
チューリングマシン
abstract model of computation for executing any computer algorithm
任意のコンピューターアルゴリズムを実行するための抽象的な計算モデル
unweighted shortest path
重みのない最短経路
problem of finding the shortest paths in terms of the number of edges
辺の数で測って最短となる経路を見つける問題
vertex
頂点
represents an element in a graph or special type of it such as a tree
グラフ、または木のようなその特殊な種類で、要素を表すもの
weighted shortest path
重み付き最短経路
problem of finding the shortest paths in terms of the sum of the edge weights
辺の重みの総和で測って最短となる経路を見つける問題