How can we help?

You can also find more resources in our Help Center.

411 terms

cs 3111444

STUDY
PLAY
abstract data type
a description of operations on a data type that could have multiple possible implementations.
ancestors
in a tree, the union of a node's parent and the parent's ancestors.
array
A contiguous block of memory containing elements of the same type, accessed by numeric index.
ASCII
(pronounced "ask-key") an abbreviation of American Standard Code for Information Interchange, a character code that maps between 8-bit binary integers and characters such as letters, numbers, and punctuation. There are 256 possible ASCII codes, of which 95 are printable.
association list
a list of pairs, where each pair has a key and a value associated with the key.
backtrack
in a tree search, to move back from the node currently being examined to its parent.
base case
a simple case that can be solved easily, without recursion.
Big O
an abstracted function that describes the amount of computer time or memory space required by an algorithm, as a function of problem size. For problems larger than a certain size, the actual time or space required will be less than the Big O multiplied by some constant.
binary tree
a tree in which each node has at most two children.
binary search
search of a binary tree or other structure, in which the size of the set to be searched is cut in half at each step.
binary search tree (BST)
...
boxed number
a number that is defined as an object, so that it has a runtime type and methods that can be used, e.g. Integer in Java.
branching factor
in a search tree, the number of children of a given node. Often, the branching factors of individual nodes will vary, so an average value may be used.
child
in a tree, a node pointed to by a parent node.
circularly linked list
a linked list in which the last element points back to the first element.
circular queue
a queue implemented within an array, where the first element of the array logically follows the last element.
class
in object-oriented programming, a description of a set of similar objects.
cons
1. in Lisp, the function that constructs a pair of pointers, or basic element of list structure. 2. a cons data structure. 3. to make a cons data structure.
constructive
describes a function that makes a new data structure but does not modify its arguments.
depth
the number of links between the root of a tree and the leaves.
depth-first search
a search in which children of a node are considered (recursively) before siblings are considered.
dereference
to convert from a pointer (address) to the data that is pointed to.
descendants
all nodes below a given node in a tree.
design pattern
a pattern that describes a set of similar programs.
destructive
describes a function that modifies its arguments.
DFS
depth-first search.
divide and conquer
a problem-solving strategy in which a problem is broken down into sub-problems, until simple subproblems are reached.
doubly linked list
a linked list in which each element has both forward and backward pointers.
fair
describes a process in which every arriving customer will eventually be served.
FIFO
first-in, first-out: describes the ordering of a queue. A queue is fair.
filter
a process that removes unwanted elements from a collection.
first-child/next-sibling
a way of implementing trees that uses two pointers per node but can represent an arbitrary number of children of a node.
garbage
1. data that is incorrect, meaningless, or random; 2. storage that is no longer pointed to by any variable and therefore can no longer be accessed.
gedanken
describes a thought experiment or view of an entity.
goal
an item (or description of items) being sought in a search.
grammar
a formal description of a language in terms of vocabulary and rules for writing phrases and sentences.
immutable
describes a data structure that cannot be changed once it has been created, such as Integer or String in Java.
inorder
an order of processing a tree in which the parent node is processed in between its children.
interior node
a node of a tree that has children.
interpreter
a program that reads instructions, determines what they say, and executes them. The CPU is an interpreter for machine language; the JVM is an interpreter for compiled Java bytecodes.
intersection
given two sets, the intersection is the set of elements that are members of both sets.
intractable
a problem that is so hard (typically exponential) that it cannot be solved unless the problem is small.
JVM
Java Virtual Machine, an interpreter for compiled Java bytecodes.
leaf
a tree node containing a contents value but with no children.
LIFO
last-in, first out: describes the order of a stack.
linear
O(n), a problem whose solution requires a linear amount of time or space if the problem is of size n.
link
a pointer to the next element in a linked list.
linked list
a sequence of records, where each record contains a link to the next one.
merge
to combine two ordered linear structures into one.
node
an element of a linked list, tree, or graph, often represented by a data structure.
null dereference
a runtime error that occurs when an operation such as a method call is attempted on a null pointer.
object
a data structure that can be identified at runtime as being a member of a class.
ontology
a description of the kinds of objects that exist in a computer program, e.g. a Java class hierarchy.
operator
in a search tree, a program that changes a state into a child state, e.g. a move in a game.
parent
in a tree, a node that points to a given node.
pointer
a variable containing the address of other data.
postorder
an order of processing a tree in which the parent node is processed after its children.
preorder
an order of processing a tree in which the parent node is processed before its children.
quadratic
O(n2), a problem whose solution requires a quadratic amount of time or space if the problem is of size n.
queue
a data structure representing a sequence of items, which are removed in the same order as they were inserted.
random access
describes a data structure or device in which all accesses have the same cost, O(1).
recursion
a case where a program calls itself.
recursive case
a condition of the input data where the data will be handled by call(s) to the same program.
reference
a pointer to data.
reference type
a type in which variables of that type are pointers to objects. In the code Integer i = 3, the variable i holds a pointer to the Integer object that contains the value. In int j = 3, the variable j contains the value. In Java, only reference types have methods.
root
the top node of a tree, from which all other nodes can be reached.
runtime stack
a stack containing a stack frame of variable values for each active invocation of a procedure.
scope
the area of program text over which a variable can be referenced.
search
to look through a data structure until a goal object is found.
sentinel
an extra record at the start or end of a data structure such as a linked list, to simplify the processing.
set difference
given two sets, the set difference is the set of elements of the first set that are not members of the second set.
shadow
to hide similar items with the same name.
side-effect
any effect of a procedure other than returning a value, e.g. printing or modifying a data structure.
sort
to modify the order of a set of elements so that a desired ordering holds between them, e.g. alphabetic order.
stack frame
a section of the runtime stack holding the values of all variables for one invocation of a procedure.
stack space
the amount of space on the runtime stack required for execution of a program.
state
a description of the state of a process, such as a board game.
structure sharing
a case where two data structures share some elements.
successor
the next element in a linked list.
tail recursive
a function whose value either does not involve a recursive call, or is exactly the value of a recursive call.
taxonomy
a classification of objects into a tree structure that groups related objects.
Unicode
a character code that maps between binary numbers and the characters used in most modern languages, more than 110,000 characters. The lowest values of the UTF-8 encoding of Unicode are the same as ASCII, allowing characters to be 8 bits when staying within the ASCII character set. For other languages, more bits are used. Java uses Unicode.
union
given two sets, the union is the set of elements that are members of either set.
virtual machine
an abstract computer that is simulated by an interpreter program running on an actual computer.
well-founded ordering
an ordering that can be guaranteed to terminate, e.g. starting at a positive integer and counting down to 0.
word
a group of bits that are treated as a unit and processed in parallel by a computer CPU. Common word sizes are 32 bits and 64 bits.
XML
eXtensible Markup Language, a way of writing data in a tree-structured form by enclosing items in pairs of opening and closing tags, e.g. <zipcode> 78712 </zipcode>
A*
a heuristic search algorithm that attempts to find a desired goal using a heuristic function to estimate the distance from a given node to the goal.
acyclic
describes a graph with no cycles (circular paths).
adjacency list
a representation of a graph in which each node has a list of nodes that are adjacent to it, i.e. connected to it by an arc.
adjacency matrix
a representation of a graph in which a boolean matrix contains a 1 at position (i,j) iff there is an arc from node i to node j.
arc
a link between two nodes in a graph.
AVL tree
a self-balancing sorted binary tree, in which the heights of subtrees differ by at most 1.
B-tree
a tree with a high branching factor, to minimize the number of disk accesses required to access a desired record.
balanced tree
a tree in which the heights of subtrees are approximately equal.
bandwidth
information transfer rate of a network connection, in bits/second.
Big O
an abstracted function that describes the amount of computer time or memory space required by an algorithm, as a function of problem size.
bijective
describes a relation that is both injective and surjective (one-to-one and onto).
binary heap
a data structure that implements a complete binary tree within an array, such that every parent node has a value that is less than the value of either of its children.
binding
an association of a name with a value.
binding list
a list structure that represents a set of bindings.
Boolean matrix
a matrix whose elements are 0 or 1.
branching factor
in a search tree, the number of children of a given node. Individual nodes will vary, so an average value may be used.
bucket
a collection, such as a linked list, of values that hash to the same value.
cache
to save a value locally to save re-computing or transferring it in the future.
Cartesian product
a set of pairs (x, y) of elements from two sets X and Y.
clustering
a situation in which many elements hash to the same hash value.
collision
when two values to be stored in a hash table have the same hash value.
comparison
the act of comparing two values to determine which is greater according to some ordering.
cons
1. in Lisp, the function that constructs a pair of pointers, or basic element of list structure. 2. to make a cons data structure. 3. a cons data structure.
critical path
in a PERT chart or scheduling graph, a path from the initial state to the goal such that any increase in time required along the critical path will increase the time to complete the whole project.
cycle
a circular path in a graph.
DAG
directed acyclic graph.
dense graph
a graph such that a large fraction of possible connections among nodes are present, i.e. the number of edges is of the order of the number of vertices squared. cf. sparse graph.
Dijkstra's algorithm
an optimal greedy algorithm to find the minimum distance and shortest path in a weighted graph from a give start node.
directed
describes an arc that can only be traversed in one direction, or a graph with such arcs.
directed acyclic graph
a directed graph with no cycles.
discrete event simulation
a simulation in terms of events, in which the highest-priority (least time) event is removed from an event queue and executed, which may have the effect of scheduling future events.
domain
the set of values that are the source values of a mapping.
edge
a link or arc between nodes in a graph.
exclusive or
a binary Boolean function whose output is 1 if its inputs are different. Abbreviated XOR.
extendible hashing
another term for hashing with buckets.
external sort
a sort using external storage in addition to main memory.
FIFO
first-in, first-out: describes the ordering of a queue.
fold
to process a set of items using a specified function; another term for reduce.
garbage
storage that is no longer pointed to by any variable and therefore can no longer be accessed.
garbage collection
the process of collecting garbage for recycling.
geometric series
a series in which each successive term is multiplied by a constant less than 1, e.g. 1 + 1/2 + 1/4 + 1/8 + ...
graph
a set of nodes and arcs connecting the nodes.
greedy algorithm
an algorithm that always tries the solution path that appears to be the best.
hash function
a function that is deterministic but randomizing, i.e. whose output is a relatively small integer that appears to be a random function of the key value.
heuristic
a function that estimates the distance from a given node to the goal in A* search. More generally, a method that generally gives good advice about which direction to go or how to approach a problem.
heuristic search
A* search.
in-place
describes a sort that does not require any additional memory.
injective
describes a mapping in which each element of the domain maps to a single element of the range. Also, one-to-one.
internal sort
a sort using only the main memory of the computer.
intersection
given two sets, the set of elements that are members of both sets.
iterator
an object containing data and methods to iterate through a collection of data, allowing processing of one data item at a time.
latency
the delay between asking for data from an I/O device and the beginning of data transfer.
linear
name for O(n) algorithm
load factor
in a hash table, the fraction of the table's capacity that is filled.
map
in MapReduce, a program that processes an element of the input and emits one or more (key, value) pairs.
mapping
association of one or more elements of a Range set with each element of a Domain set.
master
a program that controls a set of other programs or devices.
max queue
a priority queue in which the maximum element is removed first.
memory hierarchy
the use of several kinds of memory hardware in a computer system, where the fastest memory (e.g. cache) is smallest, slower memory (e.g. RAM) is larger, and the slowest memory (e.g. disk) is largest.
memory locality
the processing of data in such a way that data that are located near each other by memory address are accessed nearby in time.
min queue
a priority queue in which the minimum element is removed first.
minimum spanning tree
a tree formed from the nodes of a graph and a subset of its edges, such that all nodes are connected and the total cost of the edges is minimal.
on-line
describes a sorting algorithm that can process items one at a time.
one-to-one
describes a mapping in which each element of the domain maps to a single element of the range. Also, injective.
onto
describes a mapping in which each element of the range is the target of some element of the domain. Also, surjective.
parsing
analysis of a sentence of a language to determine the elements of the sentence and their relationship and meaning.
path
a sequence of steps along arcs in a graph.
pattern
a representation of a class of objects, containing some constant elements in relation to variable elements.
pattern variable
a part of a pattern that can match variable parts of an input.
pivot
in Quicksort, a "center" value used in partitioning the set to be sorted.
priority queue
a queue in which the highest-priority elements are removed first; within a priority value, the earliest arrival is removed first.
quadratic
name for a O(n^2) algorithm
randomized algorithm
an algorithm in which the data to be processed or the device to process it is randomly selected.
range
a set of values that are the targets of a mapping.
Red-Black tree
a self-balancing binary tree in which nodes are "colored" red or black. The longest path from the root to a leaf is no more than twice the length of the shortest path.
reduce
to apply a given function to the elements of a given list. Also, fold.
reference type
a type in which variables of that type are pointers to objects.
rehash
to apply a different hashing function to a key when a collision occurs.
scalability
the ability of an algorithm or hardware system to grow to handle a larger number of inputs.
set difference
given two sets, the set of elements of the first set that are not members of the second set.
shortest path
the shortest path between a start node and a goal node in a weighted graph. <
simple path
a path between two nodes in a graph that does not revisit any intermediate node.
slack
in a PERT chart or scheduling graph, the amount of time by which the time of an activity could be increased without affecting the overall completion time.
slave
a program or device that operates under control of a master.
sparse array
an array in which most of the elements are zero or missing.
sparse graph
a graph in which any node is connected to relatively few other nodes. cf. dense graph.
spatial locality
being close together in space, i.e. memory address.
Splay tree
a self-balancing binary tree that places recently accessed elements near the top of the tree for fast access.
stable
describes a sort algorithm in which the relative position of elements with equal keys is unchanged after sorting.
surjective
describes a mapping in which each element of the range is the target of some element of the domain. Also, onto.
symbol table
a data structure that links names to information about the objects denoted by the names.
temporal locality
being close together in time, i.e. memory accesses that occur within a short time of each other.
topological sort
a linear ordering of nodes of an acyclic graph, such that a node follows all of its graph predecessors in the ordering.
tree rotation
changing the links in a binary tree to change the relative heights of the child subtrees, while leaving the sort order of the tree unchanged.
undirected
describes a graph in which the arcs may be followed in either direction.
union
given two sets, the set of elements that are members of either set.
unparsing
converting an abstract syntax tree into a sentence in a language, such as a programming language.
vertex
a node in a graph.
weight
a number that denotes the cost of following an arc in a graph.
XML
Extensible Markup Language, a way of writing data in a tree-structured form by enclosing it in tags.
XOR
exclusive or.
insertion sort
an O(n^2) search algorithm that's similar to the way people sort playing cards. Stable, in-place and on-line. First removes element from list, inserts it in the correct position, and repeats until finished.
radix sort
an O(n*k) search algorithm where K = keylength. Stable. Sorts input into bins based on the lowest digit; then combines bins in order and sorts on the next highest digit & so forth.
quick sort
O(n*log(n)) search algorithm; in-place, not stable. Picks a pivot, reorders so lesser objects are in front of pivot, recursively sorting sub-lists of lesser and sub-lists of greater values.
merge sort
O(n*log(n)) search algorithm; stable, not in-place; breaks data in half, sorts, merges, repeats.
What is the Big O of linear search of arrays, ArrayList, and LinkedList?
O(N)
What is the Big O of binary search?
O(log(N))
What is the Big O of accessing some element in the middle of an ArrayList?
O(1)
What is the Big O of accessing some element in the middle of a LinkedList?
O(N)
What is the Big O of inserting at the front of an array or an ArrayList?
O(N)
What is the Big O of inserting at the front of a LinkedList?
O(1)
What is the Big O of inserting in the middle of an ArrayList?
O(N)
What is the Big O of quicksort?
O(n*log(N))
What is the Big O of selection sort?
O(n²)
What is the Big O of a matrix multiply?
O(n³)
Describe how log(n) grows.
Slowly
Since log(n) grows at the rate it does, what number can it be compared to?
1
10 bits is equal to about how many decimal digits?
3
O(log(n)) is better than which function?
O(N)
An int is how many bits?
32
32-bits can represent about how many decimal digits?
9
A long is how many bits?
19
64-bits can represent about how many decimal digits?
19
Which algorithms show up as straight lines on log-log graphs?
Polynomial
When there is a straight line on a log-log graph, what does the slope represent?
The order of the polynomial
Which function will produce a linear plot on semi-log paper?
Exponential
What does it mean for a function to be intractable?
It can only be computed when n is relatively small (for example, exponential)
When the ratio of times as the size of input is doubled is about 2, what is the Big O?
O(n)
When the ratio of times as the size of input is doubled is somewhat larger than 2, what is the Big O?
O( n*log(n) )
When the ratio of times as the size of input is doubled is about 4, what is the Big O?
O(n²)
When the ratio of times as the size of input is doubled is about 8, what is the Big O?
O(n³)
How can you find the Big O of a loop?
The loop count times the Big O of the contents
How can you find the Big O of an if statement?
The max of the Big O of the test, then statement, and else statement
Determine the Big O of the following code:
...
for ( i = 0; i < n; i++)
...
{
...
for (j = 0; j < n; j++)
...
sum += a[i][j];
...
}
...
}
O(n²)
What does it mean for something to be random access?
Access to any element has the same cost (for example, arrays)
What is a pointer (aka reference)?
The memory address of the beginning of a record, or block of storage
How big is a pointer?
32 bits
What is sometimes called a boxed integer?
A record that contains other pointers
For reference types, what do == and != test?
The equality of pointer values (i.e. do they have the exact same data address in memory?)
What should be used to test the equality of the contents or value of a reference type?
.equals()
To compare against null, what should be used?
== or !=
To make an Integer out of an int, what should be used?
Integer myInteger = Integer.valueOf(myInt)
What is a linked list?
A data structure where each element has two fields: a link and contents
What is a link?
A pointer to the next element
What are contents of a linked list?
Something as simple as a number, or a pointer to another linked list
How does the constructing of a linked list work?
A linked list links new elements onto the front of the list.
What does the function (cons item list) do?
It makes a new list element containing item, and adds it to the front of list
What does the following linked list produce?
...
(cons 'a '(b c))
(a b c)
What are the two fields of a cons cell called?
car and cdr
In a Cons list, first and rest have different types. What are they?
First can be any Object type, while rest is a Cons or null
What does the following produce?
...
(rest (rest '((a b) c)))
null
With respect to linked lists, what does .set(idx, element) do?
Replaces the element at the specified position in this list with the specified element.
With respect to linked lists, what does the function length produce?
The number of "things" in the linked list
What is a "thing" concerning linked lists?
A simple item such as a number or string or a balanced pair of parenthesis and everything inside of them.
What does a recursive program do?
It calls itself as a subroutine.
What are base cases?
Simple inputs for which the answer is obvious and can be determined immediately.
What does the function reverse do to a linked list?
It makes a new linked list whose elements are in reverse order of the original list
What does the function append do to a linked list?
It concatenates two lists to form a single list.
What is a constructive function?
A function that creates a new list, but does not modify the original list's arguments
What does it mean for functions to share structure?
The same list structure is part of more than one list.
What is a destructive argument?
A function that creates a list but modifies the original list's arguments
What does the function nconc do?
It concatenates two lists to form a single list; it does so by modifying the end of the first list to point to the second list
What does the function nreverse do?
It reverses a list in place by turning the pointers around.
What does the function member do?
It tests whether a given item is an element of a list. It returns the remainder of the list beginning with the desired element
What is the output:
...
(member 'dick '(tom dick harry))
(dick harry)
What does the function Intersection do?
It returns a set of elements that are members of both sets
(intersection '(a b c) '(a c e))
(c a)
What does the function Union do?
It returns the set of elements that are members of either set (basically all elements with no duplicates)
What is a circularly linked list?
The last link points back to the front of the list rather than to null or nil
What is a doubly linked list?
It has pointers that point both forward and backward
What does the function merge do?
It combines two sorted lists into one sorted list
What does it mean to divide and conquer?
To break down a large problem into two smaller problems, until the problem becomes easy
What does the function assoc do?
It provides a simple lookup tool to find information in a linked list
What is an abstract data type?
a description of operations on a data type that could have multiple possible implementations.
What is an association list?
It is a list of pairs, where each pair has a key, and a value associated with the key
What is a Cons?
The function that constructs a pair of pointers
What does depth-first search do?
It searches children of a node before siblings are considered (through recursion)
What is design pattern?
a pattern that describes a set of similar programs
What is garbage?
it can be data that is incorrect, meaningless, or random, or storage that is no longer pointed to
What is an object?
a data structure that can be identified at runtime as a member of a class
What is a parent?
In a tree, it is a node that points to a given node
What is preorder?
a way of processing a tree where the parent node is processed before the children
What is random access?
describes a data structure in which all accesses have the same costs
What is a reference?
A pointer to data
What is a runtime stack?
a stack that keeps a fresh set of values for each variable in a stack frame
What is XML?
Extensible Markup Language, it allows users to put tags around their data to describe what the pieces of data mean
What is similar to people waiting in line?
A queue
What is the term for items being inserted at the end of a queue?
enqueued
What is the term for items being removed from the front of a queue?
dequeued
What is a fair data structure?
An entry in a queue will eventually get serviced and removed so a queue is fair
What will a filter function do?
Filter removes items from a Collection if they meet a certain condition
What are the advantages to ArrayList?
get and set are O(1), and add and remove at the end are O(1) so it makes a good stack
What are the disadvantages of ArrayList?
add and remove are O(N) for randoms, contains is O(N)
What are the advantages of LinkedList?
getFirst, addFirst, removeFirst, getLast, addLast, removeLast are all O(1)
What are the disadvantages of LinkedList?
get, set, and remove are O(N)
What is a tree?
A kind of graph composed of nodes and links
What is a link?
A directed pointer from one node to another
What is a root?
The uppermost node that has no incoming links
How many links does a node that isn't the root have coming into it?
Exactly one
How many children can a node have?
Any number
What is a node with no children called?
a leaf
What are the different representations of trees that we are concerned with for Novak's class?
Binary trees, First-Child/Next-sibling, Linked lists, Implicit
What is a binary tree?
A tree in which each node has at most two children
What is a First-Child / Next-Sibling Tree?
Down arrows represent the first child, while side arrows represent the next sibling
What is the best way to remember how to draw a FC/NS Tree?
The right hand nodes all fall down
What is the goal?
The item being sought in a search
What is inorder?
an order of processing a tree in which the parent node is processed in between its children
What does a sentinel node hold or reference?
nothing
state
a description of a state of a process, such as a board game
What is well-founded ordering?
ordering that can guarantee to terminate (go down to zero)
What is the Big O
an abstract function that describes how fast a function grows as the size of the problem becomes large.
What happens to constants concerning finding the Big O of something?
They are dropped
What is the Big O of:
...
2 n^2 + 5 n + 100
O(n^2)
What is the order of binary search?
log(n)
What is the order of finding the max of an array?
O(n)
What is the order of a quicksort?
n*log(n)
What is the order of a selection sort?
n^2
What is the order of matrix multiply?
n^3
What is the order of the knapsack problem?
2^n
log(n) is almost equal to what number?
1
10 bits is equivalent to
3 decimal digits
What kind of algorithms show up as straight lines on log-log graph paper?
Polynomial
What is the worst possible order of a function that we never want to see? Think of cancer and atomic bombs
Exponential
If a function has a timing ratio of 2, what is the Big O?
n
If a function has a timing ratio of 2+, what is the Big O?
n*log(n)
If a function has a timing ratio of 4, what is the Big O?
n^2
If a function has a timing ratio of 8, what is the Big O?
n^3
What is the big o of operations such as +, =, and a[i]?
O(1)
What is the big o of initializing something?
O(n)
What is the Big O of the following code?
...
bool IsFirstElementNull(String[] strings)
...
if(strings[0] == null)
...
return true;
...
return false;
...
}
O(1)
What is the Big O of this code:
...
bool ContainsValue(String[] strings, String value)
...
for(int i = 0; i < strings.Length; i++)
...
if(strings[i] == value)
...
}
O(n)
bool ContainsDuplicates(String[] strings)
...
for(int j = 0; j < strings.Length; j++)
...
if(i == j) // Don't compare with self
...
continue;
...
if(strings[i] == strings[j])
...
}
O(n^2)
What should be used to compare against null?
== or !=
Do int and Integer have the same accuracy?
yes
Which costs more: int or Integer?
Integer costs 4 times more
what does the following lisp list produce:
...
(list 'a 'b 'c)
(a b c)
What is the best way to make an Integer from an int value?
Integer myInteger = Integer.valueOf(myint);
What is a link?
a pointer to the next element of a linked list
What are contents?
an element of a linked list. it could be a pointer or a value (like a number or string)
What are the two fields of a cons list called?
car and cdr (first and rest)
What does first refer to?
the first thing in a liked list
What is a thing?
a simple item such as a # or string
OR
...
a balanced pair of parens and everything inside
...
So keep it real my *****h!
It's a player's field my *****h!
Abstract Data Type
a description of operations on a data type that could have multiple possible implementations
Ancestors
in a tree, the union of a node's parent and the parent's ancestors
Array
A contiguous block of memory containing elements of the same type, accessed by numeric index
association list
a list of pairs, where each pair has a key and a value associated with the key
base case
a simple case that can be solved easily, without recursion
Binary Tree
a tree in which each node has at most two children
Boxed Number
a number that is defined as an object, so that it has a runtime type and methods that can be used, e.g. Integer in Java
circularly linked list
a linked list in which the last element points back to the first element
Constructive
describes a function that makes a new data structure but does not modify its arguments
Deference
to convert from a pointer (address) to the data that is pointed to.
Design Pattern
a pattern that describes a set of similar programs
DFS
depth-first search
Divide and Conquer
a problem-solving strategy in which a problem is broken down into sub-problems, until simple subproblems are reached
Doubly Linked List
a linked list in which each element has both forward and backward pointers
Fair
describes a process in which every arriving customer will eventually be served
FIFO
first-in, first-out: describes the ordering of a queue
Filter
a process that removes unwanted elements from a collection
Garbage Collection
the process of collecting garbage for recycling
Gedaken
describes a thought experiment or view of an entity
Immutable
describes a data structure that cannot be changed once it has been created, such as Integer or String in Java
Inorder
an order of processing a tree in which the parent node is processed in between its children
Interior node
a node of a tree that has children
Intersection
given two sets, the intersection is the set of elements that are members of both sets
Leaf
a tree node containing a contents value but with no children
LIFO
last-in, first out: describes the order of a stack
append concatenates...
two lists to form a single list. The
rst argument is copied; the second argument is reused
...
What does the function Nconc accomplish?
it concatenates two lists to form a single list; instead of copying the first list as append does, nconc modifies the end of the first list to point to the second list
What does the function nreverse accomplish?
reverses a list in place by turning the pointers around
What does the function member accomplish?
member tests whether a given item is an element of the list
Intersection
The intersection of two sets is the set of elements that are members of both sets
Union
the set of elements that are members of either set (return all elements with no duplicates)
Set Difference
the set of elements that are members of the first set but NOT the second set
Merge
to merge two sorted lists means to combine them into a single list so that the combined list is sorted.
Divide and Conquer
a technique for solving a large problem by breaking it into two smaller problems, until the problem becomes easy
Sort then Merge OR Merge the Sort??
Sort then merge for O(n*log(n))
Association List or alist
a simple lookup table or map
LIFO
last in first out
How are stacks processed?
LIFO
What is a queue
a data structure that implements waiting in line: items are inserted (enqueued) at the end of the queue and removed (dequeued) from the front (FIFO)
FIFO
first in first out
fair data structure
an entry will eventually get removed and get service (as in a queue)
What does a filter do?
removes items from a Collection if they meet some condition
What is the arithmetic expression of this tree?
...
=
...
/ \
...
Y +
...
* B
...
m x
y = m*x + b
List the different representation of trees
Binary tree, First child/next sibling, linked list, implicit
Binary tree
contents and left and right links
First-child/next-sibling
contents, first-child, next sibling
Linked List
the first element contains the contents, the rest are a linked list of children
Implicit
a node may contain only the contents; the children can be generated from the contents or from the location of the parent