CSC 231 Final Exam Terms
Template
"... is a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class to work on many different data types without being rewritten for each one. Templates are of great utility to programmers in C++, especially when combined with multiple inheritance and operator overloading." - Wikipedia
AVL tree
A balanced binary search tree where the height of the two subtrees (children) of a node differs by at most one.
Full binary tree
A binary tree in which each node has exactly zero or two children.
Balanced Binary Tree
A binary tree where no leaf is more than a certain amount farther from the root than any other. After inserting or deleting a node, the tree may rebalanced with "rotations."
Perfect binary tree
A binary tree with all leaf nodes at the same depth. All internal nodes have degree 2.
Descendant
A child of a node in a tree, any of the children of the children, etc.
Instance
A class is a definition of a set of data and member functions. When space for the data is actually allocated, we say that a member of the class has been instantiated. The instantiation is called an instance of the class. Each instance has its own set of data (there is also a mechanism in C++ to define data that is only allocated once per class, and shared amongst all instances of the class).
Stack
A collection of items in which only the most recently added item may be removed. The latest added item is at the top. Basic operations are push and pop. Often top and isEmpty are available, too. Also known as "last-in, first-out" or LIFO.
Quadratic Probing
A collision resolution scheme designed to avoid clustering. Instead of probing simply to the next available position, quadratic probing checks first for the next position (1 2), but then checks for the 4 th position (2 2), then the 9 th positon (3 2), ...
Chaining
A collision resolution scheme where the data is stored in a linked format such as in a linked list connected to each position in the table.
C++
A compiled, general-purpose programming language that "has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights." (Wikipedia).
Binary Heap
A complete binary tree where every node has a key more extreme (greater for max heaps or less for min heaps) than or equal to the key of its parent.
Object Oriented Programming
A concept of programming in which elements of the program are coded as stand-alone objects. Each object is completely self-contained in that it incorporates methods whereby the object can manipulate its own characteristics. A "Door" object, for instance would know how to open and close itself. It would also be able to respond to interrogation and advise the enquirer whether it is currently open or closed.
Edge
A connection between two vertices.
Vector
A data collection similar to arrays but can change their size dynamically.
Vertex
A data item or node in a graph.
Tree
A data structure containing zero or more nodes that are linked together in a hierarchical fashion
Linked List
A data structure in which a list of nodes or elements of a data structure connected by pointers.
Singly Linked List
A data structure in which a list of nodes or elements of a data structure connected by pointers.
Priority queue
A data structure in which added items are dequeued or released from the collection according to their importance or priority.
Doubly Linked List
A data structure in which each element contains pointers to the next and previous elements in the list, thus forming a bidirectional linear list.
Queue
A data structure with first-in first-out behavior, supporting the operations enqueue (to insert) and dequeue (to remove)
Binary Search Tree
A data structure within which every node refers to a left subtree and a right subtree such that all values in the left subtree are smaller than the value in the node and all elements in the right subtree are greater than (or equal to) the value in the node. The top node is called the root. The nodes with no children (left and right subtrees empty) are called leaves.
Hash Table
A dictionary in which keys are mapped to array positions by a hash function. It provides O(1) look-up for searches based on keys and may be used to implement associative arrays.
Textfile
A file containing only printable text and white space.
Class implementation file
A file where the definition of a class is written - in a very simple class this is sometimes done in a .h file - other times the interface or declaration for the class is written in a .h file and the class implementation file is written in a .cpp file.
Linear Probing
A form of collision resolution that looks for the desired position by looking at the next adjacent position until the desired position has been found. This form of probing is generally not used because of clustering.
Hash Function
A formula that provides the home position in the hash table for data.
Uniform distribution
A good hash function will provide this type of distribution of the data within the hash table.
Complete
A graph in which every vertex shares an edge with every other vertex in the graph
Undirected
A graph is undirected if all its edges are bi-directional
Unweighted
A graph where all the edges have the same cost
Digraph or directed graph
A graph where the arcs (edges) have a specific direction.
Finite graph
A graph with a finite number of edges and vertices.
Infinite graph
A graph with an infinite number of edges and/or vertices.
Sparse graph
A graph with only a "few" edges for most vertices ("few" may depend on context).
Acyclic graph
A graph without cycles
Circular List
A linked list in which the rear item refers back to the head item
String
A list of characters, usually implemented as an array. Informally a word, phrase, sentence, etc. Since text processing is so common, a special type with substring operations is often available.
Ragged matrix
A matrix having irregular numbers of items in each row.
Uniform matrix
A matrix having the same number of items in each row.
Structure
A mechanism which allows objects of different types to be grouped together as a single compound type.
Subtree
A node and all its descendants.
Sibling
A node in a tree that has the same parent as another node.
Internal Node
A node of a tree that has one or more child nodes, equivalently, one that is not a leaf
Internal node
A node with at least one child.
Clustering
A non-uniform distribution of data in a hash table where large segments of the table are filled while others are empty.
Ancestor
A parent ... of a node in a tree, the parent of the parent, etc.
Ray
A path originating at one vertex within an infinite graph
Header file
A programmer defined file, usually with a .h extension, that is included in other files also containing c++ code.
Path
A sequence of edges originating at one vertex and leading to a destination vertex
Binary File
A series of bytes in a file that can be accessed according to their data types without string processing and delimiters.
Forest
A set of 0 or more disjoint trees.
Abstract Data Type
A set of data values and associated operations that are precisely specified independent of any particular implementation.
Disjoint Set
A set whose members do not overlap.
Linear Search
A simple, though inefficient, search algorithm that operates by sequentially examining each element in a list until the target element is found or the last has been completely processed.
Index File
A small file that contains search values and the location of the larger data - these files are often used to speed up non-primary key searches.
Selection Sort
A sort algorithm that repeatedly looks through remaining items to find the least one and moving it to its final location. The run time is O(n2), where n is the number of comparisons and the number of swaps is O(n).
Merge sort
A sort algorithm that splits the items to be sorted into two groups, recursively sorts each group, and merges them into a final, sorted sequence.
Binary Tree
A specific type of tree data structure in which each node has at most two subtrees, one left and one right.
Spanning tree
A subgraph without cycles that includes all the graphs vertices
Minimum spanning tree
A subgraph without cycles that includes all the graphs vertices and that has the least cost among all spanning trees
Subgraph
A subset of a graph's edges and vertices
Tree Traversal
A technique for processing the nodes of a tree in some order.
Overload
A term used to refer to the use of one symbol for more than one purpose. For instance, in mathematics the "-" symbol is used both as a negation symbol and as a subtraction symbol. In C++ the "<".
Big-O notation
A theoretical measure of the execution of an algorithm, usually the time or memory needed, given the problem size n, which is usually the number of items. Big O notations indicates how the work of the algorithm increases as the size of the data set increases.
Complete Binary Tree
A tree of depth d whose leaves are at level d
Matrix
A two-dimensional array. By convention, the first index is the row, and the second index is the column.
Class declaration file
A type of header file where the interface or declaration of a class is written. The code for the definition of the class is written in the class implementation file.
Binary Search
A type of search algorithm that seeks an item, with a known name, in an ordered list by first comparing the sought item to the item at the middle of the list's order. The search then divides the list in two, determines in which half of the order the item should be, and repeats this process, until the sought item is found. It's complexity is O(log2 n).
Node
A unit of reference in a data structure. Also called a vertex in graphs and trees.
Argument
A value passed to a called function by the calling function.
Parameter
A value received by a called function from a calling function.
Sink
A vertex in a digraph that only has incoming arcs.
Source
A vertex in a digraph that only has outgoing arcs.
Leaf
A vertex with a degree of 1.
Cycle
A walk or tour that begins at one vertex and returns to that same vertex without repeating any vertex in the walk.
Collision Resolution Scheme
A way of handling collisions, that is, when two or more items should be kept in the same location, especially in a hash table. The general ways are keeping subsequent items within the table (open addressing), keeping a list for items which collide (direct chaining hashing or separate chaining hashing), keeping a special overflow area, etc. Perfect hashes avoid collisions, but may be time-consuming to create.
Tree
An acyclic graph
Recursion
An algorithmic technique where a function, in order to accomplish a task, calls itself with some part of the task.
Arc
An edge of a directed graph
Bridge
An edge whose removal would create a disconnected graph
Loop
An edge whose source and destination is the same vertex.
Load
An important density measure for a hash table that is computed by the number of data items over then number of positions in the hash table.
Quicksort
An in-place sort algorithm that uses the divide and conquer paradigm. It picks an element from the array (the pivot), partitions the remaining elements into those greater than and less than this pivot, and recursively sorts the partitions
Child
An item or node of a tree referred to by a parent item.
Rectangular matrix
An n × m matrix, or, one whose size may not be the same in both dimensions.
Algorithm
An ordered, executable set of steps to achieve a desired result.
Open addressing
Any collision resolution scheme that places all the data in the hash table rather than relying on some way of storing some of the data outside the table. Probing strategies are a form of open addressing. Chaining is not a form of open addressing.
Leaf
Any node (location) in a tree structure that is at the farthest distance from the root (primary node), no matter which path is followed.
Object
Any program entity which uses physical memory in the computer
Sort
Arrange items in a predetermined order. There are dozens of algorithms, the choice of which depends on factors such as the number of items relative to working memory, knowledge of the orderliness of the items or the range of the keys, the cost of comparing keys vs. the cost of moving items, etc.
Merge
Combine two or more sorted sequences of data into a single sorted sequence.
Min-heap property
Each node in a tree has a key which is greater than or equal to the key of its parent.
Max-heap property
Each node in a tree has a key which is less than or equal to the key of its parent.
Heap property
Each node in the heap has an equal or more important in relation to it's descendants.
Heap
Generally a binary tree where every level of the tree is filled except for the lowest level which is filled from left to right.
Driver file or class
Generally an application which uses various other classes or programs.
Average case
Having to do with the mathematical average of all cases.
Left rotation
In a binary search tree, pushing a node N down and to the left to balance the tree. N's right child replaces N, and the right child's left child becomes N's right child.
Right rotation
In a binary search tree, pushing a node N down and to the right to balance the tree. N's left child replaces N, and the left child's right child becomes N's left child.
Heap sort
In a min or max heap, the progressive removal of nodes from the top of the heap will result in a sorted traversal of the data.
Array
In programming, a list of data values, all of the same type, any element of which can be referenced by an expression consisting of the array name followed by an indexing expression. Arrays are part of the fundamentals of data structures, which, in turn, are a major fundamental of computer programming.
Scope resolution operator
It's an operator, ::, that is used to define a function outside a class from which it was declared. It can also be used with a global variable that has a local variable with same name. Thus the operator is used to define the scope of either data or functions - sometimes its use is required and sometimes it simply makes the code more clear.
Logarithmic complexity
O(log n)
Linear complexity
O(n)
Quadratic complexity
O(n2) -examples include selection sort, bubble sort, and insertion sort.
Access operators
Operators that indicate that the data on the right of the operator belongs to the data on the left side of the operator.
Level-order Traversal
Process all nodes of a tree by depth: first the root, then the children of the root, etc.
Post-order traversal
Process all nodes of a tree by recursively processing the left subtree, then processing the right subtree, and finally the root.
In-order Traversal
Process all nodes of a tree by recursively processing the left subtree, then processing the root, and finally the right subtree.
Preorder traversal
Process all nodes of a tree by recursively processing the root, then processing the left subtree, and finally the right subtree.
Isolated vertex
Refers to vertex without any edges.
Bubble Sort
Sort by comparing each adjacent pair of items in a list in turn, swapping the items if necessary, and repeating the pass through the list until no swaps are done.
Insertion Sort
Sort by repeatedly taking the next item and inserting it into the final data structure in its proper order with respect to items already inserted.
Run time
The amount of time needed to execute an algorithm.
Weight
The cost associated with processing or traversing an edge.
Root
The distinguished initial or fundamental item of a tree. The only item which has no parent. The ancestor of all a tree's nodes.
Head
The first item of a list.
Tail
The last item of a list.
Height
The length of the longest path from the root to the furthest tree node.
Depth
The length of the path from that node to the root. The depth of the root is 0.
Degree
The number of that node's children.
Order
The number of vertices in a graph.
Key
The part of a group of data by which it is sorted, indexed, cross referenced, etc.
Home position
The position originally designated by the hash function for a particular data item.
Worst case
The situation or input that forces an algorithm or data structure to take the most time or resources.
Data Structure
The term data structure refers to the way data is organized for use within a program. Correct organization of data can lead to simpler and more efficient algorithms.
Rotation
To switch children and parents among two or three adjacent nodes to restore balance to a tree
Adjacent
Two nodes that are connected through an edge
Perculate up
When an item is added to a priority queue implemented as a heap, it is added to the next available position in the heap, and then it switches positions with its parent until the heap order property is fulfilled.
Perculate down
When an item is removed from a priority queue, the item in the last position of the heap is placed at the root, and then it switches positions with its appropriate child until the heap order position is fulfilled.
Collision
When two or more different keys hash to the same value or position in a hash table.
Dense graph
a graph where the number of edges approaches the number of vertices (not a rigid definition and often depends on context).
FIFO
a policy that items are processed in order of arrival. A queue implements this.
Union
a set having all members in either set.
Level
all the nodes sharing the same depth.
Asymptotic lower bound
as a function of the size of the input, is the best (fastest, least amount of space used, etc.) an algorithm can possibly achieve to solve a problem. That is, no algorithm can use fewer resources than the bound.
Hypergraph
graph in which an edge can join any number of vertices.
Degree of a vertex
is equal to the number of its edges.
Perfect hash function
places all the data in their home positions without any collisions.
LIFO
the most recently arrived item is processed first. A stack implements this.
Size
the number of edges in a graph.