When there is a straight line on a log-log graph, what does the slope represent?
The order of the polynomial
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 somewhat larger than 2, what is the Big O?
O( n*log(n) )
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];
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
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 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
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
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 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 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 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 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 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 does depth-first search do?
It searches children of a node before siblings are considered (through recursion)
What is garbage?
it can be data that is incorrect, meaningless, or random, or storage that is no longer pointed to
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 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 advantages of LinkedList?
getFirst, addFirst, removeFirst, getLast, addLast, removeLast are all O(1)
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 First-Child / Next-Sibling Tree?
Down arrows represent the first child, while side arrows represent the next sibling
What is inorder?
an order of processing a tree in which the parent node is processed in between its children
Abstract Data Type
a description of operations on a data type that could have multiple possible implemations
a way of implementing trees that uses two pointers per node but can represent an arbitrary number of children of a node.
describes a data structure that canot be changed once it has been created, such as Integer or String in Java.
a program that reads instructions, determines what they say, and executes them. The CPU is an interpreter for machine languages; the JVM is an interpreter for compiled.
O(n) a problem whose solution requires a linear amount of time or space if the problem is size n.
in a tree search, to move back from the node from the node currently being examined to it's parent
an abstracted function that describes the amount of problem size. For problems lager than a certain time, the actual time or space required will be less than the Big O multiplied by some constant.
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
a queue implemented within an array, where the first element of the array logically follows the last element.
in Lisp,the function that constructs a pair of pinters, or basic element of list structure. a cons structure. to make a cons data structure.
a search in which children of a node are considered(recursively) before siblings are concerned.
divide and conquer
a problem-solving strategy inwhich a problem is broken down into sub-problems, until simple subproblems are related.
a formal description of a language in terms of vocabulary and rules for writing phrases and sentences.